Skip to content

Commit f0b2e76

Browse files
committed
Fix promoted image handoff to prod
1 parent 76d0d9c commit f0b2e76

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
runs-on: ${{ format('codebuild-java-cdk-serverless-clamscan-stage-us-east-runner-{0}-{1}', github.run_id, github.run_attempt) }}
2727
environment: stage-us-east
2828
outputs:
29-
resolved_image_uri: ${{ steps.capture-image.outputs.resolved_image_uri }}
29+
resolved_image_uri: ${{ steps.capture_image.outputs.resolved_image_uri }}
3030

3131
steps:
3232
- name: Checkout Code
@@ -118,7 +118,7 @@ jobs:
118118
mvn --batch-mode --no-transfer-progress exec:java
119119
120120
- name: Capture Tested Image Manifest For Promotion
121-
id: capture-image
121+
id: capture_image
122122
working-directory: ./cdk
123123
run: |
124124
FUNCTION_NAME=$(aws cloudformation describe-stacks \
@@ -212,6 +212,11 @@ jobs:
212212
- name: Promote Tested Image Into Production ECR
213213
run: |
214214
SOURCE_IMAGE_URI="${{ needs.deploy-stage.outputs.resolved_image_uri }}"
215+
if [ -z "$SOURCE_IMAGE_URI" ]; then
216+
echo "Stage job did not provide a resolved image URI for promotion." >&2
217+
exit 1
218+
fi
219+
215220
SOURCE_REGISTRY="${SOURCE_IMAGE_URI%%/*}"
216221
TARGET_REPOSITORY_NAME="cdk-hnb659fds-container-assets-${AWS_ACCOUNT_ID}-${{ vars.AWS_REGION || 'us-east-1' }}"
217222
PROMOTED_IMAGE_TAG="promoted-${GITHUB_SHA}"

0 commit comments

Comments
 (0)