diff --git a/run.sh b/run.sh index 15cade6..08413cb 100755 --- a/run.sh +++ b/run.sh @@ -19,7 +19,7 @@ if [[ "${command}" == "release" ]]; then fi if [[ "${command}" == "rustup" ]]; then - if [[ "$#" -ne 2 ]]; then + if [[ "$#" -lt 2 ]] || [[ "$#" -gt 3 ]]; then echo "Usage: $0 rustup [commit]" exit 1 fi @@ -48,5 +48,11 @@ if [[ "$(uname)" == "Linux" ]]; then cargo build --release fi +# If the PROMOTE_RELEASE_RUSTUP_OVERRIDE_VERSION environment variable is set, +# forward it to the Docker environment. +if [[ "$PROMOTE_RELEASE_RUSTUP_OVERRIDE_VERSION" != "" ]]; then + docker compose exec -e "PROMOTE_RELEASE_RUSTUP_OVERRIDE_VERSION=${PROMOTE_RELEASE_RUSTUP_OVERRIDE_VERSION}" -T local "/src/local/${command}.sh" "${channel}" "${override_commit}" +fi + # Run the command inside the docker environment. docker compose exec -T local "/src/local/${command}.sh" "${channel}" "${override_commit}"