File tree Expand file tree Collapse file tree
task-processor-deploy-ecs Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -153,3 +153,28 @@ runs:
153153 aws ecs wait services-stable --cluster ${{ inputs.aws_ecs_cluster_name }} --services ${{ inputs.aws_ecs_service_name }}
154154 aws ecs wait services-stable --cluster ${{ inputs.aws_ecs_cluster_name }} --services ${{ inputs.aws_ecs_sdk_service_name }}
155155 shell : bash
156+
157+ - name : Verify correct version is running
158+ shell : bash
159+ run : |
160+ EXPECTED_TASK_DEF=${{ steps.deploy-api-task-def.outputs.task-definition-arn }}
161+ RUNNING_ADMIN_API_TASK_DEF=$(aws ecs describe-services \
162+ --cluster ${{ inputs.aws_ecs_cluster_name }} \
163+ --services ${{ inputs.aws_ecs_service_name }} \
164+ --query 'services[0].deployments[?status==`PRIMARY`].taskDefinition' \
165+ --output text)
166+ RUNNING_SDK_API_TASK_DEF=$(aws ecs describe-services \
167+ --cluster ${{ inputs.aws_ecs_cluster_name }} \
168+ --services ${{ inputs.aws_ecs_sdk_service_name }} \
169+ --query 'services[0].deployments[?status==`PRIMARY`].taskDefinition' \
170+ --output text)
171+ if [[ "$RUNNING_ADMIN_API_TASK_DEF" == "$EXPECTED_TASK_DEF" && \
172+ "$RUNNING_SDK_API_TASK_DEF" == "$EXPECTED_TASK_DEF" ]]; then
173+ exit 0
174+ else
175+ echo "Task definition mismatch detected"
176+ echo "Expected: $EXPECTED_TASK_DEF"
177+ echo "Admin API running: $RUNNING_ADMIN_API_TASK_DEF"
178+ echo "SDK API running: $RUNNING_SDK_API_TASK_DEF"
179+ exit 1
180+ fi
Original file line number Diff line number Diff line change 4141 image : ${{ inputs.api_ecr_image_url }}
4242
4343 - name : Deploy Amazon ECS Task Processor task definition
44+ id : deploy-task-processor-task-def
4445 uses : aws-actions/amazon-ecs-deploy-task-definition@v2
4546 with :
4647 cluster : ${{ inputs.aws_ecs_cluster_name }}
5253 aws ecs wait services-stable --cluster ${{ inputs.aws_ecs_cluster_name }} --services ${{
5354 inputs.aws_ecs_service_name }}
5455 shell : bash
56+
57+ - name : Verify correct version is running
58+ shell : bash
59+ run : |
60+ EXPECTED_TASK_DEF=${{ steps.deploy-task-processor-task-def.outputs.task-definition-arn }}
61+ RUNNING_TASK_DEF=$(aws ecs describe-services \
62+ --cluster ${{ inputs.aws_ecs_cluster_name }} \
63+ --services ${{ inputs.aws_ecs_service_name }} \
64+ --query 'services[0].deployments[?status==`PRIMARY`].taskDefinition' \
65+ --output text)
66+ if [[ "$RUNNING_TASK_DEF" == "$EXPECTED_TASK_DEF" ]]; then
67+ exit 0
68+ else
69+ echo "Task definition mismatch detected"
70+ echo "Expected: $EXPECTED_TASK_DEF"
71+ echo "Task Processor running: $RUNNING_TASK_DEF"
72+ exit 1
73+ fi
Original file line number Diff line number Diff line change 99 - .github/**
1010 - infrastructure/aws/production/**
1111
12+ concurrency :
13+ group : ${{ github.workflow }}
14+ cancel-in-progress : true
15+
1216jobs :
1317 deploy-ecs :
1418 uses : ./.github/workflows/.reusable-deploy-ecs.yml
Original file line number Diff line number Diff line change 1010 - infrastructure/aws/staging/**
1111 workflow_dispatch :
1212
13+ concurrency :
14+ group : ${{ github.workflow }}
15+ cancel-in-progress : true
16+
1317jobs :
1418 deploy-ecs :
1519 uses : ./.github/workflows/.reusable-deploy-ecs.yml
1620 with :
1721 environment : staging
18- secrets : inherit
22+ secrets : inherit
You can’t perform that action at this time.
0 commit comments