From 4e2b39fa6f9ace5f9c6b3743ab37e2554f3e13f9 Mon Sep 17 00:00:00 2001 From: Mykhailo Kuznietsov Date: Wed, 4 Mar 2020 11:39:58 +0200 Subject: [PATCH] Fix latest image tag for release (#16108) Signed-off-by: Mykhailo Kuznietsov --- .ci/cico_common.sh | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/.ci/cico_common.sh b/.ci/cico_common.sh index 7c802d256b..da2f512b9e 100644 --- a/.ci/cico_common.sh +++ b/.ci/cico_common.sh @@ -166,15 +166,15 @@ buildImages() { done } -tagImages() { +tagLatestImages() { for image in ${IMAGES_LIST[@]} do - echo y | docker tag "${REGISTRY}/${image}:$1" + echo y | docker tag "${image}:$1" "${image}:latest" if [[ ${image} == "${ORGANIZATION}/che-server" ]]; then - docker tag "${REGISTRY}/${image}:$1" "${REGISTRY}/${image}:$1-centos" + docker tag "${image}:$1-centos" "${image}:latest-centos" fi if [[ $? -ne 0 ]]; then - die_with "docker push of '${image}' image is failed!" + die_with "docker tag of '${image}' image is failed!" fi done } @@ -188,19 +188,21 @@ pushImagesOnQuay() { return fi for image in ${IMAGES_LIST[@]} - do - echo y | docker push "${image}:$1" - if [[ $2 == "pushLatest" ]]; then - echo y | docker push "${REGISTRY}/${image}:latest" - fi - - if [[ ${image} == "${REGISTRY}/${ORGANIZATION}/che-server" ]]; then - echo y | docker push "${REGISTRY}/${ORGANIZATION}/che-server:$1-centos" - fi - if [[ $? -ne 0 ]]; then - die_with "docker push of '${image}' image is failed!" - fi - done + do + echo y | docker push "${image}:$1" + if [[ $2 == "pushLatest" ]]; then + echo y | docker push "${REGISTRY}/${image}:latest" + fi + if [[ ${image} == "${REGISTRY}/${ORGANIZATION}/che-server" ]]; then + if [[ $2 == "pushLatest" ]]; then + echo y | docker push "${REGISTRY}/${ORGANIZATION}/che-server:latest-centos" + fi + echo y | docker push "${REGISTRY}/${ORGANIZATION}/che-server:$1-centos" + fi + if [[ $? -ne 0 ]]; then + die_with "docker push of '${image}' image is failed!" + fi + done } @@ -225,7 +227,6 @@ releaseProject() { git push --tags || die_with "Failed to push tags. Please do this manually" git checkout ${tag} buildImages ${tag} - pushImagesOnQuay ${tag} - tagImages "latest" - pushImagesOnQuay "latest" + tagLatestImages ${tag} + pushImagesOnQuay ${tag} pushLatest }