-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: parameter expansion using
circleci env subst
(#71)
- Loading branch information
1 parent
4d1fb6c
commit 8d81a59
Showing
2 changed files
with
25 additions
and
0 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,15 +1,23 @@ | ||
#!/bin/bash | ||
|
||
ORB_VAL_REGISTRY_URL="$(circleci env subst "$ORB_VAL_REGISTRY_URL")" | ||
ORB_VAL_IMAGE="$(circleci env subst "$ORB_VAL_IMAGE")" | ||
ORB_VAL_DIGEST_PATH="$(circleci env subst "$ORB_VAL_DIGEST_PATH")" | ||
|
||
IFS="," read -ra DOCKER_TAGS <<< "$ORB_EVAL_TAG" | ||
PROJECT_ID="${!ORB_ENV_PROJECT_ID}" | ||
|
||
for tag_to_eval in "${DOCKER_TAGS[@]}"; do | ||
TAG=$(eval echo "$tag_to_eval") | ||
set -x | ||
docker push "$ORB_VAL_REGISTRY_URL/$PROJECT_ID/$ORB_VAL_IMAGE:$TAG" | ||
set +x | ||
done | ||
|
||
if [ -n "$ORB_VAL_DIGEST_PATH" ]; then | ||
mkdir -p "$(dirname "$ORB_VAL_DIGEST_PATH")" | ||
SAMPLE_FIRST=$(eval echo "${DOCKER_TAGS[0]}") | ||
set -x | ||
docker image inspect --format="{{index .RepoDigests 0}}" "$ORB_VAL_REGISTRY_URL/$PROJECT_ID/$ORB_VAL_IMAGE:$SAMPLE_FIRST" > "$ORB_VAL_DIGEST_PATH" | ||
set +x | ||
fi |