Skip to content

Commit a88d87a

Browse files
authored
Merge PR #5796: Backport "CI: Use new build-number script"
2 parents 31c8707 + 4cd0f90 commit a88d87a

File tree

3 files changed

+8
-21
lines changed

3 files changed

+8
-21
lines changed

.ci/azure-pipelines/build_linux.bash

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,9 @@
1919
# MUMBLE_BUILD_NUMBER_TOKEN - Access token for the build number page on our server.
2020
#
2121

22-
if [[ -n "$MUMBLE_BUILD_NUMBER_TOKEN" ]]; then
23-
VERSION=$(python "scripts/mumble-version.py")
24-
BUILD_NUMBER=$(curl "https://mumble.info/get-build-number?commit=${BUILD_SOURCEVERSION}&version=${VERSION}&token=${MUMBLE_BUILD_NUMBER_TOKEN}")
25-
else
26-
BUILD_NUMBER=0
27-
fi
22+
VERSION=$("./scripts/mumble-version.py")
23+
BUILD_NUMBER=$("./scripts/mumble-build-number.py" --commit "${BUILD_SOURCEVERSION}" --version "${VERSION}" \
24+
--password "${MUMBLE_BUILD_NUMBER_TOKEN}" --default 0)
2825

2926
cd $BUILD_BINARIESDIRECTORY
3027

.ci/azure-pipelines/build_macos.bash

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,9 @@
3030
# MUMBLE_BUILD_NUMBER_TOKEN - Access token for the build number page on our server.
3131
#
3232

33-
if [[ -n "$MUMBLE_BUILD_NUMBER_TOKEN" ]]; then
34-
VERSION=$(python "scripts/mumble-version.py")
35-
BUILD_NUMBER=$(curl "https://mumble.info/get-build-number?commit=${BUILD_SOURCEVERSION}&version=${VERSION}&token=${MUMBLE_BUILD_NUMBER_TOKEN}")
36-
else
37-
BUILD_NUMBER=0
38-
fi
33+
VERSION=$("./scripts/mumble-version.py")
34+
BUILD_NUMBER=$("./scripts/mumble-build-number.py" --commit "${BUILD_SOURCEVERSION}" --version "${VERSION}" \
35+
--password "${MUMBLE_BUILD_NUMBER_TOKEN}" --default 0)
3936

4037
cd $BUILD_BINARIESDIRECTORY
4138

.ci/build_windows.bat

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,8 @@
2828
:: https://stackoverflow.com/a/6362922
2929
for /f "tokens=* USEBACKQ" %%g in (`python "scripts\mumble-version.py"`) do (set "VERSION=%%g")
3030

31-
:: For some really stupid reason we can't have this statement and the one where we set the VERSION variable in the same if body as
32-
:: in that case the variable substitution of that variable in the expression below fails (is replaced with empty string)
33-
:: Also we can't anything else inside the if body as this will cause the curl command to always be executed.
34-
if defined MUMBLE_BUILD_NUMBER_TOKEN (
35-
for /f "tokens=* USEBACKQ" %%g in (`curl "https://mumble.info/get-build-number?commit=%MUMBLE_SOURCE_COMMIT%&version=%VERSION%&token=%MUMBLE_BUILD_NUMBER_TOKEN%"`) do (set "BUILD_NUMBER=%%g")
36-
) else (
37-
echo Build number token not set - defaulting to 0
38-
set BUILD_NUMBER=0
39-
)
31+
for /f "tokens=* USEBACKQ" %%g in (`python "scripts\mumble-build-number.py" --commit "%MUMBLE_SOURCE_COMMIT%" --version "%VERSION%" ^
32+
--password "%MUMBLE_BUILD_NUMBER_TOKEN%" --default 0`) do (set "BUILD_NUMBER=%%g")
4033

4134
:: Create build directory if it doesn't exist.
4235
if not exist "%MUMBLE_BUILD_DIRECTORY%" mkdir "%MUMBLE_BUILD_DIRECTORY%

0 commit comments

Comments
 (0)