diff options
author | Tim Smith <tsmith@chef.io> | 2021-07-28 14:55:48 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-28 14:55:48 -0700 |
commit | 971787113384b4d6d383868b974b09e36360d042 (patch) | |
tree | e343ed9fb25177bec58ebb690983c09c2840919d | |
parent | 60c8b1ff7347603eedf04bda1634d7a576d3cedd (diff) | |
parent | 18972cb51529005bb1bb8a87624d4d44e3216d1c (diff) | |
download | chef-971787113384b4d6d383868b974b09e36360d042.tar.gz |
Merge pull request #11873 from chef/nkierpiec/update-docker-channel-tag
Update use of environment variable when artifact is promoted
-rwxr-xr-x | .expeditor/build-docker-images.sh | 1 | ||||
-rwxr-xr-x | .expeditor/docker-manifest-create.sh | 21 | ||||
-rwxr-xr-x | .expeditor/promote-docker-images.sh | 17 |
3 files changed, 26 insertions, 13 deletions
diff --git a/.expeditor/build-docker-images.sh b/.expeditor/build-docker-images.sh index b7da52042f..73fafa5d99 100755 --- a/.expeditor/build-docker-images.sh +++ b/.expeditor/build-docker-images.sh @@ -1,4 +1,5 @@ #! /bin/bash +set -eu -o pipefail arch=$1 diff --git a/.expeditor/docker-manifest-create.sh b/.expeditor/docker-manifest-create.sh index 7a2da6cdd6..267159b8f7 100755 --- a/.expeditor/docker-manifest-create.sh +++ b/.expeditor/docker-manifest-create.sh @@ -1,11 +1,20 @@ #! /bin/bash +set -eu -o pipefail export DOCKER_CLI_EXPERIMENTAL=enabled -echo "--- Creating chef/chef:${EXPEDITOR_VERSION} multiarch manifest" -docker manifest create "chef/chef:${EXPEDITOR_VERSION}" \ - --amend "chef/chef:${EXPEDITOR_VERSION}-amd64" \ - --amend "chef/chef:${EXPEDITOR_VERSION}-arm64" +function create_and_push_manifest() { + manifest_tag="${1}" -echo "--- Pushing chef/chef:${EXPEDITOR_VERSION} multiarch manifest" -docker manifest push "chef/chef:${EXPEDITOR_VERSION}"
\ No newline at end of file + echo "--- Creating manifest for ${manifest_tag}" + docker manifest create "chef/chef:${manifest_tag}" \ + --amend "chef/chef:${EXPEDITOR_VERSION}-arm64" \ + --amend "chef/chef:${EXPEDITOR_VERSION}-amd64" + + echo "--- Pushing manifest for ${manifest_tag}" + docker manifest push "chef/chef:${manifest_tag}" +} + +# create the initial version and initial channel docker images +create_and_push_manifest "${EXPEDITOR_VERSION}" +create_and_push_manifest "${EXPEDITOR_CHANNEL}"
\ No newline at end of file diff --git a/.expeditor/promote-docker-images.sh b/.expeditor/promote-docker-images.sh index dcbceefd64..9625fed16b 100755 --- a/.expeditor/promote-docker-images.sh +++ b/.expeditor/promote-docker-images.sh @@ -1,21 +1,24 @@ #! /bin/bash +set -eu -o pipefail export DOCKER_CLI_EXPERIMENTAL=enabled function create_and_push_manifest() { - echo "--- Creating manifest for ${1}" - docker manifest create "chef/chef:${1}" \ + manifest_tag="${1}" + + echo "--- Creating manifest for ${manifest_tag}" + docker manifest create "chef/chef:${manifest_tag}" \ --amend "chef/chef:${EXPEDITOR_VERSION}-arm64" \ --amend "chef/chef:${EXPEDITOR_VERSION}-amd64" - echo "--- Pushing manifest for ${1}" - docker manifest push "chef/chef:${1}" + echo "--- Pushing manifest for ${manifest_tag}" + docker manifest push "chef/chef:${manifest_tag}" } -# unstable, stable, current -create_and_push_manifest "${EXPEDITOR_TARGET_CHANNEL}" +# create the promoted channel docker image +create_and_push_manifest "${EXPEDITOR_CHANNEL}" -if [[ $EXPEDITOR_TARGET_CHANNEL == "stable" ]]; then +if [[ ${EXPEDITOR_CHANNEL} == "stable" ]]; then create_and_push_manifest "latest" # split the version and add the tags for major and major.minor |