diff options
author | Clement Tsang <34804052+ClementTsang@users.noreply.github.com> | 2023-01-02 15:18:05 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-02 15:18:05 -0500 |
commit | 7c53f088c3933812847b7359c50cad8c0fa315a4 (patch) | |
tree | 20bc95fc687b6ffa42fda53f0b795f1f69762f07 /scripts | |
parent | a56e7f6cc9c0515d15576c7b06392c0b0c79b288 (diff) |
ci: add build hash to nightly builds for version (#951)
This adds the build hash to the btm -V output for nightly builds, making it easier to troubleshoot when someone might have obtained a nightly build, and what commit it corresponds to.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/cirrus/build.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/cirrus/build.py b/scripts/cirrus/build.py index 02e34347..d2440a61 100644 --- a/scripts/cirrus/build.py +++ b/scripts/cirrus/build.py @@ -28,17 +28,24 @@ DL_URL_TEMPLATE = "https://api.cirrus-ci.com/v1/artifact/build/%s/%s/binaries/%s def make_query_request(key: str, branch: str, build_type: str): print("Creating query request.") mutation_id = "Cirrus CI Build {}-{}-{}".format(build_type, branch, int(time())) + + # Dumb but if it works... + config_override = ( + Path(".cirrus.yml").read_text().replace("# -PLACEHOLDER FOR CI-", 'BTM_BUILD_RELEASE_CALLER: "nightly"') + ) query = """ mutation CreateCirrusCIBuild ( $repo: ID!, $branch: String!, - $mutation_id: String! + $mutation_id: String!, + $config_override: String, ) { createBuild( input: { repositoryId: $repo, branch: $branch, clientMutationId: $mutation_id, + configOverride: $config_override } ) { build { @@ -52,6 +59,7 @@ def make_query_request(key: str, branch: str, build_type: str): "repo": "6646638922956800", "branch": branch, "mutation_id": mutation_id, + "config_override": dedent(config_override), } data = {"query": dedent(query), "variables": params} data = json.dumps(data).encode() |