forked from solana-labs/solana
-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: introduce ci/docker/env.sh (#3774)
Co-authored-by: sakridge <[email protected]> (cherry picked from commit f320175)
- Loading branch information
1 parent
8dadea5
commit 789f67e
Showing
6 changed files
with
52 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
FROM ubuntu:20.04 | ||
ARG BASE_IMAGE= | ||
FROM ${BASE_IMAGE} | ||
|
||
ARG \ | ||
RUST_VERSION= \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env bash | ||
|
||
ci_docker_env_sh_here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
|
||
# shellcheck disable=SC1091 | ||
source "${ci_docker_env_sh_here}/../rust-version.sh" | ||
|
||
if [[ -z "${rust_stable}" || -z "${rust_nightly}" ]]; then | ||
echo "Error: rust_stable or rust_nightly is empty. Please check rust-version.sh." >&2 | ||
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 | ||
|
||
hash_vars=( | ||
"${BASE_IMAGE}" | ||
"${RUST_VERSION}" | ||
"${RUST_NIGHTLY_VERSION}" | ||
"${GOLANG_VERSION}" | ||
"${NODE_MAJOR}" | ||
"${SCCACHE_VERSION}" | ||
"${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}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters