Fixed script so the releases for alpha and beta are not built as latest

This commit is contained in:
jfederico 2019-09-23 17:03:36 +00:00
parent 091b548e90
commit 9967e276c0
1 changed files with 2 additions and 2 deletions

View File

@ -86,8 +86,8 @@ docker login -u="$CD_DOCKER_USERNAME" -p="$CD_DOCKER_PASSWORD"
echo "#### Docker image $CD_DOCKER_REPO:$CD_REF_NAME is being published"
docker push $CD_DOCKER_REPO
# Publish latest and v2 if it id a release
if [[ "$CD_REF_NAME" == *"release"* ]]; then
# Publish image as latest and v2 if it is a release (excluding alpha and beta)
if [[ "$CD_REF_NAME" == *"release"* ]] && [[ "$CD_REF_NAME" != *"alpha"* ]] && [[ "$CD_REF_NAME" != *"beta"* ]]; then
docker_image_id=$(docker images | grep -E "^$CD_DOCKER_REPO.*$CD_REF_NAME" | awk -e '{print $3}')
docker tag $docker_image_id $CD_DOCKER_REPO:latest
docker push $CD_DOCKER_REPO:latest