diff --git a/docker/scripts/release.sh b/docker/scripts/release.sh index cbafc17..109bce4 100755 --- a/docker/scripts/release.sh +++ b/docker/scripts/release.sh @@ -25,6 +25,18 @@ create_git_tag() { } retag_and_push_image() { + IMAGE="${LOKALISE_REGISTRY}/${GIT_REPO_NAME}/${APP_NAME}" + + log "Retaging image with ${IMAGE}:${TAG}" + + docker pull ${IMAGE}:PRE-${GIT_BASE_BRANCH} + docker tag ${IMAGE}:PRE-${GIT_BASE_BRANCH} ${IMAGE}:${TAG} + docker tag ${IMAGE}:PRE-${GIT_BASE_BRANCH} ${IMAGE}:latest + docker push ${IMAGE}:${TAG} + docker push ${IMAGE}:latest +} + +retag_and_push_image_ecr() { IMAGE="${LOKALISE_ECR_REGISTRY}/${GIT_REPO_NAME}/${APP_NAME}" log "Retaging ECR image with ${IMAGE}:${TAG}" @@ -93,6 +105,7 @@ case ${action} in git_tag) create_git_tag retag_and_push_image + retag_and_push_image_ecr ;; git_release) create_git_release