From 57d5a20cb3ee617d27de752936a5261e2ba71568 Mon Sep 17 00:00:00 2001 From: Jan David Date: Tue, 7 Jan 2025 14:39:14 +0100 Subject: [PATCH] Explicitly forward version in local tests --- run.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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}"