Skip to content

Commit d623c56

Browse files
committed
ci: extract running the build into a script
1 parent 6104aa7 commit d623c56

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

src/ci/azure-pipelines/steps/run.yml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -150,22 +150,9 @@ steps:
150150
condition: and(succeeded(), not(variables.SKIP_JOB), eq(variables['IMAGE'], 'mingw-check'))
151151
displayName: Verify the publish_toolstate script works
152152

153-
- bash: |
154-
set -e
155-
# Remove any preexisting rustup installation since it can interfere
156-
# with the cargotest step and its auto-detection of things like Clippy in
157-
# the environment
158-
rustup self uninstall -y || true
159-
if [ "$IMAGE" = "" ]; then
160-
src/ci/run.sh
161-
else
162-
src/ci/docker/run.sh $IMAGE
163-
fi
164-
#timeoutInMinutes: 180
153+
- bash: src/ci/scripts/run-build-from-ci.sh
165154
timeoutInMinutes: 600
166155
env:
167-
CI: true
168-
SRC: .
169156
AWS_ACCESS_KEY_ID: $(SCCACHE_AWS_ACCESS_KEY_ID)
170157
AWS_SECRET_ACCESS_KEY: $(SCCACHE_AWS_SECRET_ACCESS_KEY)
171158
TOOLSTATE_REPO_ACCESS_TOKEN: $(TOOLSTATE_REPO_ACCESS_TOKEN)

src/ci/scripts/run-build-from-ci.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
# Start the CI build. You shouldn't run this locally: call either src/ci/run.sh
3+
# or src/ci/docker/run.sh instead.
4+
5+
set -euo pipefail
6+
IFS=$'\n\t'
7+
8+
source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
9+
10+
export CI="true"
11+
export SRC=.
12+
13+
# Remove any preexisting rustup installation since it can interfere
14+
# with the cargotest step and its auto-detection of things like Clippy in
15+
# the environment
16+
rustup self uninstall -y || true
17+
if [ -z "${IMAGE+x}" ]; then
18+
src/ci/run.sh
19+
else
20+
src/ci/docker/run.sh "${IMAGE}"
21+
fi

0 commit comments

Comments
 (0)