1
0
Fork 0

always set buildkite branch and commit env

This commit is contained in:
Mikhail Goncharov 2022-03-05 17:26:07 +01:00
parent 5a16fb7b9a
commit b88d7a8dba

View file

@ -52,8 +52,11 @@ if __name__ == '__main__':
steps.extend(bazel([], force=True))
if os.getenv('ph_skip_generated') is None:
# BUILDKITE_COMMIT might be an alias, e.g. "HEAD". Resolve it to make the build hermetic.
if os.getenv('BUILDKITE_COMMIT', 'HEAD') == "HEAD":
env['BUILDKITE_COMMIT'] = os.getenv('BUILDKITE_COMMIT')
if env['BUILDKITE_COMMIT'] == "HEAD":
env['BUILDKITE_COMMIT'] = repo.head.commit.hexsha
env['BUILDKITE_BRANCH'] = os.getenv('BUILDKITE_BRANCH')
env['BUILDKITE_MESSAGE'] = os.getenv('BUILDKITE_MESSAGE')
for gen in steps_generators:
steps.extend(from_shell_output(gen, env=env))