| # 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.contrib.buildbucket_trigger import InputProperties |
| |
| DEPS = [ |
| "fuchsia/buildbucket_util", |
| "recipe_engine/buildbucket", |
| "recipe_engine/properties", |
| "recipe_engine/swarming", |
| ] |
| |
| PROPERTIES = InputProperties |
| |
| |
| 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.buildbucket_util.test("default") + api.properties(builders=["builder"]) |