From 34c6d0bec934c153853139efd00685f756bcb92b Mon Sep 17 00:00:00 2001 From: sarahpeiffer Date: Mon, 27 Sep 2021 16:37:45 -0700 Subject: [PATCH] change tag syntax for mcr repo check --- .../ServiceGroupRoot/Scripts/pushAgentToAcr.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/deployment/agent-deployment/ServiceGroupRoot/Scripts/pushAgentToAcr.sh b/deployment/agent-deployment/ServiceGroupRoot/Scripts/pushAgentToAcr.sh index c3f092d90..d39cedde0 100644 --- a/deployment/agent-deployment/ServiceGroupRoot/Scripts/pushAgentToAcr.sh +++ b/deployment/agent-deployment/ServiceGroupRoot/Scripts/pushAgentToAcr.sh @@ -8,24 +8,24 @@ if [ -z $AGENT_IMAGE_TAG_SUFFIX ]; then exit 1 fi +if [ -z $AGENT_RELEASE ]; then + echo "-e error AGENT_RELEASE shouldnt be empty. check release variables" + exit 1 +fi + #Make sure that tag being pushed will not overwrite an existing tag in mcr MCR_TAG_RESULT="`wget -qO- https://mcr.microsoft.com/v2/azuremonitor/containerinsights/ciprod/tags/list`" if [ $? -ne 0 ]; then echo "-e error unable to get list of mcr tags for azuremonitor/containerinsights/ciprod repository" exit 1 fi -TAG_EXISTS=$(echo $MCR_TAG_RESULT | jq '.tags | contains(["'"$AGENT_IMAGE_TAG_SUFFIX"'"])') +TAG_EXISTS=$(echo $MCR_TAG_RESULT | jq '.tags | contains(["'"$AGENT_RELEASE$AGENT_IMAGE_TAG_SUFFIX"'"])') if $TAG_EXISTS; then echo "-e error ${AGENT_IMAGE_TAG_SUFFIX} already exists in mcr. make sure the image tag is unique" exit 1 fi -if [ -z $AGENT_RELEASE ]; then - echo "-e error AGENT_RELEASE shouldnt be empty. check release variables" - exit 1 -fi - if [ -z $AGENT_IMAGE_FULL_PATH ]; then echo "-e error AGENT_IMAGE_FULL_PATH shouldnt be empty. check release variables" exit 1