]> git.lizzy.rs Git - rust.git/blob - src/ci/scripts/setup-environment.sh
temporary retry around msys2 install
[rust.git] / src / ci / scripts / setup-environment.sh
1 #!/bin/bash
2 # This script guesses some environment variables based on the builder name and
3 # the current platform, to reduce the amount of variables defined in the CI
4 # configuration.
5
6 set -euo pipefail
7 IFS=$'\n\t'
8
9 source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
10
11 # Builders starting with `dist-` are dist builders, but if they also end with
12 # `-alt` they are alternate dist builders.
13 if [[ "${CI_JOB_NAME}" = dist-* ]]; then
14     if [[ "${CI_JOB_NAME}" = *-alt ]]; then
15         echo "alternate dist builder detected, setting DEPLOY_ALT=1"
16         ciCommandSetEnv DEPLOY_ALT 1
17     else
18         echo "normal dist builder detected, setting DEPLOY=1"
19         ciCommandSetEnv DEPLOY 1
20     fi
21 fi
22
23 # All the Linux builds happen inside Docker.
24 if isLinux; then
25     if [[ -z "${IMAGE+x}" ]]; then
26         echo "linux builder detected, using docker to run the build"
27         ciCommandSetEnv IMAGE "${CI_JOB_NAME}"
28     else
29         echo "a custom docker image is already set"
30     fi
31 fi