File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,11 +104,19 @@ jobs:
104104 - name : fix cdk.json for diff - existing tag
105105 if : ${{ inputs.DEPLOY_CDK_CODE == false }}
106106 run : |
107- VERSION_NUMBER=$(aws cloudformation describe-stacks --stack-name "$STACK_NAME" --query "Stacks[0].Tags[?Key=='version'].Value" --output text)
108- COMMIT_ID=$(aws cloudformation describe-stacks --stack-name "$STACK_NAME" --query "Stacks[0].Tags[?Key=='commit'].Value" --output text)
109- if [ "${VERSION_NUMBER}" == "" ]; then
110- echo "Can not find target tag. Using initial tag in repo"
111- export VERSION_NUMBER="v1.0.4-alpha"
107+ if aws cloudformation describe-stacks --stack-name "$STACK_NAME" >/dev/null 2>&1; then
108+ VERSION_NUMBER=$(aws cloudformation describe-stacks \
109+ --stack-name "$STACK_NAME" \
110+ --query "Stacks[0].Tags[?Key=='version'].Value" \
111+ --output text)
112+ COMMIT_ID=$(aws cloudformation describe-stacks \
113+ --stack-name "$STACK_NAME" \
114+ --query "Stacks[0].Tags[?Key=='commit'].Value" \
115+ --output text)
116+ else
117+ echo "Initial deployment. Using unknown tag"
118+ VERSION_NUMBER="unknown"
119+ COMMIT_ID="unknown"
112120 fi
113121 VERSION_NUMBER="${VERSION_NUMBER}" \
114122 COMMIT_ID="${COMMIT_ID}" \
You can’t perform that action at this time.
0 commit comments