| # 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 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"]) |
| ) |