diff --git a/.travis.yml b/.travis.yml index 79e3d84c60..b5542072fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -198,10 +198,12 @@ jobs: if: commit_message =~ /\[community release .*\]/ before_script: - source scripts/set-release-variables.sh + - bash scripts/check-existing-tags.sh "alfresco/alfresco-governance-share-community" script: - bash scripts/release.sh "community" before_deploy: - bash scripts/zip-artifacts-staging.sh "community" + - bash scripts/pushDockerDigestTag.sh -i quay.io/alfresco/alfresco-governance-repository-community -i quay.io/alfresco/alfresco-governance-share-community -r quay.io -t ${RELEASE_VERSION} deploy: - provider: s3 access_key_id: ${STAGING_AWS_ACCESS_KEY} @@ -222,10 +224,12 @@ jobs: if: commit_message =~ /\[enterprise release .*\]/ before_script: - source scripts/set-release-variables.sh + - bash scripts/check-existing-tags.sh "alfresco/alfresco-governance-share-enterprise" script: - bash scripts/release.sh "enterprise" before_deploy: - bash scripts/zip-artifacts-staging.sh "enterprise" + - bash scripts/pushDockerDigestTag.sh -i quay.io/alfresco/alfresco-governance-repository-enterprise -i quay.io/alfresco/alfresco-governance-share-enterprise -r quay.io -t ${RELEASE_VERSION} deploy: - provider: s3 access_key_id: ${STAGING_AWS_ACCESS_KEY} diff --git a/scripts/check-existing-tags.sh b/scripts/check-existing-tags.sh new file mode 100644 index 0000000000..dee1edabc3 --- /dev/null +++ b/scripts/check-existing-tags.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +alfresco_docker_image=$1 +# Verify release tags +get_tags="$(curl https://hub.docker.com/r/$alfresco_docker_image/tags/ | grep -o '\"result\".*\"]')" +arrayTags=($get_tags) + +echo "Existing Tags: $get_tags" + +for tag in "${arrayTags[@]}" +do + if [[ $tag = ${RELEASE_VERSION} ]]; then + echo "Tag ${RELEASE_VERSION} already pushed, release process will interrupt." + exit 0 + fi +done + +echo "The ${RELEASE_VERSION} tag was not found"