2022-04-28 22:26:17 +00:00
|
|
|
PYTHON_VERSION_COMPATIBILITY = "PY3"
|
|
|
|
|
|
|
|
DEPS = [
|
|
|
|
"depot_tools/bot_update",
|
|
|
|
"depot_tools/gclient",
|
|
|
|
"recipe_engine/buildbucket",
|
|
|
|
"recipe_engine/context",
|
|
|
|
"recipe_engine/path",
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
def RunSteps(api):
|
|
|
|
# TODO(denniskempin): Consider using git directly for simpler config
|
2022-05-04 23:07:55 +00:00
|
|
|
gitilies = api.buildbucket.build.input.gitiles_commit
|
|
|
|
if gitilies.host:
|
|
|
|
url = "http://%s/%s" % (gitilies.host, gitilies.project)
|
|
|
|
else:
|
|
|
|
cl = api.buildbucket.build.input.gerrit_changes[0]
|
|
|
|
gs_suffix = "-review.googlesource.com"
|
|
|
|
host = cl.host
|
|
|
|
if host.endswith(gs_suffix):
|
|
|
|
host = "%s.googlesource.com" % host[: -len(gs_suffix)]
|
|
|
|
url = "http://%s/%s" % (host, cl.project)
|
2022-04-28 22:26:17 +00:00
|
|
|
|
|
|
|
gclient_config = api.gclient.make_config()
|
|
|
|
s = gclient_config.solutions.add()
|
2022-05-04 23:07:55 +00:00
|
|
|
s.url = url
|
2022-04-28 22:26:17 +00:00
|
|
|
s.name = "src"
|
|
|
|
gclient_config.got_revision_mapping[s.name] = "got_revision"
|
|
|
|
|
|
|
|
with api.context(cwd=api.path["cache"].join("builder")):
|
|
|
|
update_result = api.bot_update.ensure_checkout(gclient_config=gclient_config)
|
|
|
|
|
|
|
|
# At this point the code for the Gerrit CL is checked out at
|
|
|
|
# `api.path['cache'].join('builder')`, which by default is preserved locally
|
|
|
|
# on the bot machine and re-used between different builds for the same
|
|
|
|
# builder.
|
|
|
|
|
|
|
|
# TODO(denniskempin): Add some sort of build and/or verification step(s).
|
|
|
|
|
|
|
|
|
|
|
|
def GenTests(api):
|
|
|
|
yield api.test(
|
2022-05-04 23:07:55 +00:00
|
|
|
"basic try",
|
2022-04-28 22:26:17 +00:00
|
|
|
# These are just to make the JSON expectation file data look closer to
|
|
|
|
# reality. Project and git_repo will be filled in "for real" by the LUCI
|
|
|
|
# Change Verifier service when it creates your build.
|
|
|
|
api.buildbucket.try_build(
|
|
|
|
project="crosvm",
|
|
|
|
git_repo="https://chromium.googlesource.com/crosvm/crosvm",
|
|
|
|
),
|
|
|
|
)
|
2022-05-04 23:07:55 +00:00
|
|
|
yield api.test(
|
|
|
|
"basic ci",
|
|
|
|
# These are just to make the JSON expectation file data look closer to
|
|
|
|
# reality. Project and git_repo will be filled in "for real" by the LUCI
|
|
|
|
# Change Verifier service when it creates your build.
|
|
|
|
api.buildbucket.ci_build(
|
|
|
|
project="crosvm",
|
|
|
|
git_repo="https://chromium.googlesource.com/crosvm/crosvm",
|
|
|
|
),
|
|
|
|
)
|