blob: 606676af482027db829067a2e4f43eb1a26affd7 [file] [log] [blame]
# Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Recipe for triggering buildbucket builds."""
from recipe_engine.config import List
from recipe_engine.recipe_api import Property
from PB.recipes.fuchsia.buildbucket_trigger import InputProps
DEPS = [
"fuchsia/status_check",
"recipe_engine/buildbucket",
"recipe_engine/properties",
"recipe_engine/swarming",
]
PROPERTIES = InputProps
def RunSteps(api, props):
api.buildbucket.run(
[
api.buildbucket.schedule_request(
builder, swarming_parent_run_id=api.swarming.task_id
)
for builder in props.builders
],
collect_interval=props.interval,
timeout=props.timeout,
)
def GenTests(api):
yield (
api.status_check.test("default")
+ api.buildbucket.ci_build(
bucket="ci",
git_repo="https://fuchsia.googlesource.com/example",
revision="a" * 40,
)
+ api.properties(builders=["builder"])
)