summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2021-07-28 14:55:48 -0700
committerGitHub <noreply@github.com>2021-07-28 14:55:48 -0700
commit971787113384b4d6d383868b974b09e36360d042 (patch)
treee343ed9fb25177bec58ebb690983c09c2840919d
parent60c8b1ff7347603eedf04bda1634d7a576d3cedd (diff)
parent18972cb51529005bb1bb8a87624d4d44e3216d1c (diff)
downloadchef-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.sh1
-rwxr-xr-x.expeditor/docker-manifest-create.sh21
-rwxr-xr-x.expeditor/promote-docker-images.sh17
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