From ef5444fa29f0d51c223679c5a10a30992632c0ef Mon Sep 17 00:00:00 2001 From: yihau Date: Wed, 11 Dec 2024 16:09:23 +0800 Subject: [PATCH] avoid env name collision --- ci/docker/build.sh | 14 +++++++------- ci/docker/env.sh | 32 ++++++++++++++++---------------- sdk/docker-solana/build.sh | 2 +- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/ci/docker/build.sh b/ci/docker/build.sh index c37a821673577c..de234b8846e960 100755 --- a/ci/docker/build.sh +++ b/ci/docker/build.sh @@ -16,13 +16,13 @@ fi echo "build image: ${CI_DOCKER_IMAGE:?}" docker build "${platform[@]}" \ -f "$here/Dockerfile" \ - --build-arg "BASE_IMAGE=${BASE_IMAGE}" \ - --build-arg "RUST_VERSION=${RUST_VERSION}" \ - --build-arg "RUST_NIGHTLY_VERSION=${RUST_NIGHTLY_VERSION}" \ - --build-arg "GOLANG_VERSION=${GOLANG_VERSION}" \ - --build-arg "NODE_MAJOR=${NODE_MAJOR}" \ - --build-arg "SCCACHE_VERSION=${SCCACHE_VERSION}" \ - --build-arg "GRCOV_VERSION=${GRCOV_VERSION}" \ + --build-arg "BASE_IMAGE=${CI_DOCKER_ARG_BASE_IMAGE}" \ + --build-arg "RUST_VERSION=${CI_DOCKER_ARG_RUST_VERSION}" \ + --build-arg "RUST_NIGHTLY_VERSION=${CI_DOCKER_ARG_RUST_NIGHTLY_VERSION}" \ + --build-arg "GOLANG_VERSION=${CI_DOCKER_ARG_GOLANG_VERSION}" \ + --build-arg "NODE_MAJOR=${CI_DOCKER_ARG_NODE_MAJOR}" \ + --build-arg "SCCACHE_VERSION=${CI_DOCKER_ARG_SCCACHE_VERSION}" \ + --build-arg "GRCOV_VERSION=${CI_DOCKER_ARG_GRCOV_VERSION}" \ -t "$CI_DOCKER_IMAGE" . docker push "$CI_DOCKER_IMAGE" diff --git a/ci/docker/env.sh b/ci/docker/env.sh index d59183278d9bb4..b45faef51f8630 100755 --- a/ci/docker/env.sh +++ b/ci/docker/env.sh @@ -10,25 +10,25 @@ if [[ -z "${rust_stable}" || -z "${rust_nightly}" ]]; then exit 1 fi -export BASE_IMAGE=ubuntu:22.04 -export RUST_VERSION="${rust_stable}" -export RUST_NIGHTLY_VERSION="${rust_nightly}" -export GOLANG_VERSION=1.21.3 -export NODE_MAJOR=18 -export SCCACHE_VERSION=v0.8.1 -export GRCOV_VERSION=v0.8.18 +export CI_DOCKER_ARG_BASE_IMAGE=ubuntu:22.04 +export CI_DOCKER_ARG_RUST_VERSION="${rust_stable}" +export CI_DOCKER_ARG_RUST_NIGHTLY_VERSION="${rust_nightly}" +export CI_DOCKER_ARG_GOLANG_VERSION=1.21.3 +export CI_DOCKER_ARG_NODE_MAJOR=18 +export CI_DOCKER_ARG_SCCACHE_VERSION=v0.8.1 +export CI_DOCKER_ARG_GRCOV_VERSION=v0.8.18 hash_vars=( - "${BASE_IMAGE}" - "${RUST_VERSION}" - "${RUST_NIGHTLY_VERSION}" - "${GOLANG_VERSION}" - "${NODE_MAJOR}" - "${SCCACHE_VERSION}" - "${GRCOV_VERSION}" + "${CI_DOCKER_ARG_BASE_IMAGE}" + "${CI_DOCKER_ARG_RUST_VERSION}" + "${CI_DOCKER_ARG_RUST_NIGHTLY_VERSION}" + "${CI_DOCKER_ARG_GOLANG_VERSION}" + "${CI_DOCKER_ARG_NODE_MAJOR}" + "${CI_DOCKER_ARG_SCCACHE_VERSION}" + "${CI_DOCKER_ARG_GRCOV_VERSION}" ) hash_input=$(IFS="_"; echo "${hash_vars[*]}") ci_docker_hash=$(echo -n "${hash_input}" | sha256sum | head -c 8) -SANITIZED_BASE_IMAGE="${BASE_IMAGE//:/-}" -export CI_DOCKER_IMAGE="anzaxyz/ci:${SANITIZED_BASE_IMAGE}_rust-${RUST_VERSION}_${RUST_NIGHTLY_VERSION}_${ci_docker_hash}" +CI_DOCKER_SANITIZED_BASE_IMAGE="${CI_DOCKER_ARG_BASE_IMAGE//:/-}" +export CI_DOCKER_IMAGE="anzaxyz/ci:${CI_DOCKER_SANITIZED_BASE_IMAGE}_rust-${CI_DOCKER_ARG_RUST_VERSION}_${CI_DOCKER_ARG_RUST_NIGHTLY_VERSION}_${ci_docker_hash}" diff --git a/sdk/docker-solana/build.sh b/sdk/docker-solana/build.sh index a10bbc8a3c613f..fc234e9a12beb0 100755 --- a/sdk/docker-solana/build.sh +++ b/sdk/docker-solana/build.sh @@ -31,7 +31,7 @@ cp -f ../../fetch-spl.sh usr/bin/ ) docker build \ - --build-arg "BASE_IMAGE=${BASE_IMAGE}" \ + --build-arg "BASE_IMAGE=${CI_DOCKER_ARG_BASE_IMAGE}" \ -t anzaxyz/agave:"$CHANNEL_OR_TAG" . maybeEcho=