Skip to content

Commit

Permalink
make env var uppercase
Browse files Browse the repository at this point in the history
  • Loading branch information
Emilgardis committed Jul 8, 2022
1 parent 6f51995 commit 11d74e6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions ci/test-cross-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ set -eo pipefail
if [[ -z "${TARGET}" ]]; then
export TARGET="aarch64-unknown-linux-gnu"
fi
# ^^subst is not supported on macOS bash (bash <4)
export TARGET_UPPER=$(echo "$TARGET" | awk '{print toupper($0)}')

if [[ "${IMAGE}" ]]; then
# shellcheck disable=SC2140
export "CROSS_TARGET_${TARGET//-/_}_IMAGE"="${IMAGE}"
export "CROSS_TARGET_${TARGET_UPPER//-/_}_IMAGE"="${IMAGE}"
fi

if [[ -z "${CROSS_TARGET_CROSS_IMAGE}" ]]; then
Expand All @@ -20,7 +22,7 @@ fi

main() {

docker run --rm -e TARGET -e "CROSS_TARGET_${TARGET//-/_}_IMAGE" \
docker run --rm -e TARGET -e "CROSS_TARGET_${TARGET_UPPER//-/_}_IMAGE" \
-v /var/run/docker.sock:/var/run/docker.sock \
"${CROSS_TARGET_CROSS_IMAGE}" sh -c '
#!/usr/bin/env sh
Expand Down
6 changes: 4 additions & 2 deletions ci/test-docker-in-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ set -eo pipefail
if [[ -z "${TARGET}" ]]; then
export TARGET="aarch64-unknown-linux-gnu"
fi
# ^^subst is not supported on macOS bash (bash <4)
export TARGET_UPPER=$(echo "$TARGET" | awk '{print toupper($0)}')

if [[ "${IMAGE}" ]]; then
# shellcheck disable=SC2140
export "CROSS_TARGET_${TARGET//-/_}_IMAGE"="${IMAGE}"
export "CROSS_TARGET_${TARGET_UPPER//-/_}_IMAGE"="${IMAGE}"
fi

source=$(dirname "${BASH_SOURCE[0]}")
Expand All @@ -23,7 +25,7 @@ main() {
docker run -v "${home}":"${home}" -w "${home}" \
--rm -e TARGET -e RUSTFLAGS -e RUST_TEST_THREADS \
-e LLVM_PROFILE_FILE -e CARGO_INCREMENTAL \
-e "CROSS_TARGET_${TARGET//-/_}_IMAGE" \
-e "CROSS_TARGET_${TARGET_UPPER//-/_}_IMAGE" \
-v /var/run/docker.sock:/var/run/docker.sock \
docker:18.09-dind sh -c '
#!/usr/bin/env sh
Expand Down

0 comments on commit 11d74e6

Please sign in to comment.