Skip to content

Commit

Permalink
avoid env name collision
Browse files Browse the repository at this point in the history
  • Loading branch information
yihau committed Dec 11, 2024
1 parent 16671aa commit ef5444f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
14 changes: 7 additions & 7 deletions ci/docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
32 changes: 16 additions & 16 deletions ci/docker/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
2 changes: 1 addition & 1 deletion sdk/docker-solana/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down

0 comments on commit ef5444f

Please sign in to comment.