From 5d8d17a45aaad00bbe7da78e19677730de83cc54 Mon Sep 17 00:00:00 2001 From: Davide Beatrici Date: Thu, 21 Jan 2021 19:53:18 +0100 Subject: 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_ --- .ci/azure-pipelines/build_linux.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to '.ci/azure-pipelines/build_linux.bash') 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 -- cgit v1.2.3