diff options
author | Davide Beatrici <git@davidebeatrici.dev> | 2021-01-21 21:53:18 +0300 |
---|---|---|
committer | Robert Adam <krzmbrzl@gmail.com> | 2021-01-22 11:08:46 +0300 |
commit | 5d8d17a45aaad00bbe7da78e19677730de83cc54 (patch) | |
tree | e3212b174a55b57cbf0d298d096dcd6477ef2850 /.ci/azure-pipelines/build_linux.bash | |
parent | 75ed6142612371090c434ff4436fdd55e60fec2d (diff) |
CI(azure): Fix usage of BUILD_NUMBER_TOKEN
Turns out environment variables cannot be exported globally:
"/.ci/azure-pipelines/main.yml (Line: 7, Col: 1): Unexpected value 'env'"
It has to be done for each step that makes use of the variable.
Furthermore if a variable is not defined on Azure, the expansion
$(MY_VARIABLE) does not resolve to an empty String (as is the case e.g.
in Bash) but this expression is then taken literally without any
expansion at all. Therefore we have to make sure that the
BUILD_NUMBER_TOKEN variable is always defined. Thus we define it in
main-pr.yml as for PRs we don't define it on Azure.
In order for these variables to not interfere with each other, the
variable name inside the scripts was prefixed with MUMBLE_
Diffstat (limited to '.ci/azure-pipelines/build_linux.bash')
-rwxr-xr-x | .ci/azure-pipelines/build_linux.bash | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/.ci/azure-pipelines/build_linux.bash b/.ci/azure-pipelines/build_linux.bash index a1f7e9fe0..f5cca72fa 100755 --- a/.ci/azure-pipelines/build_linux.bash +++ b/.ci/azure-pipelines/build_linux.bash @@ -16,12 +16,12 @@ # # Defined on Azure Pipelines: # -# BUILD_NUMBER_TOKEN - Access token for the build number page on our server. +# MUMBLE_BUILD_NUMBER_TOKEN - Access token for the build number page on our server. # -if [[ -n "$BUILD_NUMBER_TOKEN" ]]; then +if [[ -n "$MUMBLE_BUILD_NUMBER_TOKEN" ]]; then VERSION=$(python "scripts/mumble-version.py" --project) - BUILD_NUMBER=$(curl "https://mumble.info/get-build-number?version=$VERSION_$AGENT_JOBNAME&token=$BUILD_NUMBER_TOKEN") + BUILD_NUMBER=$(curl "https://mumble.info/get-build-number?version=$VERSION_$AGENT_JOBNAME&token=$MUMBLE_BUILD_NUMBER_TOKEN") else BUILD_NUMBER=0 fi |