crosvm/infra/recipes/push_to_github.py
Dennis Kempin dd4b8f1676 infra: Add push-to-github builder
The builder runs as a post-submit and will force push changes to github.
Authentication is done via an access token stored in gcloud secrets
manager.

For this to work in the bot pool, the bots need to be reconfigured to
receive the scope needed for access to the secrets API as done in
https://crrev.com/i/4782519

Once this bot is working, the kokoro one can be turned off. Since we
mirror from platform/crosvm to the new repo, luci is triggered for all
new changes.

BUG=b:233913820
TEST=./recipe.py run push_to_github

Change-Id: I45478a076b87767ec10f0d0148c0713da7656264
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3671131
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-05-31 21:26:19 +00:00

29 lines
843 B
Python

# Copyright 2022 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from recipe_engine.post_process import Filter
PYTHON_VERSION_COMPATIBILITY = "PY3"
DEPS = [
"crosvm",
"recipe_engine/buildbucket",
"recipe_engine/context",
"recipe_engine/raw_io",
"recipe_engine/step",
"recipe_engine/path",
"recipe_engine/file",
]
def RunSteps(api):
api.crosvm.prepare_source()
with api.context(cwd=api.crosvm.source_dir):
# Execute push in a bash script so there is no chance of leaking the github token via luci
# logs.
api.step("Pushing to github", ["bash", api.resource("push_to_github.sh")])
def GenTests(api):
yield (api.test("basic") + api.post_process(Filter("Pushing to github")))