Skip to content

Commit 6b0cb56

Browse files
BCDA-9722: update version checks to account for multiple containers (#1299)
## 🎫 Ticket https://jira.cms.gov/browse/BCDA-9722 ## 🛠 Changes <!-- What was added, updated, or removed in this PR? --> - update deploy-all version checks to account for multiple containers per task ## ℹ️ Context <!-- Why were these changes made? Add background context suitable for a non-technical audience. --> <!-- If any of the following security implications apply, this PR must not be merged without Stephen Walter's approval. Explain in this section and add @SJWalter11 as a reviewer. - Adds a new software dependency or dependencies. - Modifies or invalidates one or more of our security controls. - Stores or transmits data that was not stored or transmitted before. - Requires additional review of security implications for other reasons. --> Recent AWS GuardDuty testing has added a new container to some ECS tasks, which has caused our deploy-all workflow to fail on the version-check step. This update should make the version check flexible enough to handle multi-container tasks. ## 🧪 Validation <!-- How were the changes verified? Did you fully test the acceptance criteria in the ticket? Provide reproducible testing instructions and screenshots if applicable. --> Manual testing against dev environment
1 parent 8786935 commit 6b0cb56

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/deploy-all.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ jobs:
237237
- run: |
238238
aws ecs wait services-stable --cluster bcda-${{ env.RELEASE_ENV }} --services bcda-${{ env.RELEASE_ENV }}-worker
239239
WORKER_ARN=$(aws ecs list-tasks --cluster=bcda-${{ env.RELEASE_ENV }} --service-name=bcda-${{ env.RELEASE_ENV }}-worker --query 'taskArns[0]' --output text)
240-
WORKER_IMAGE=$(aws ecs describe-tasks --cluster=bcda-${{ env.RELEASE_ENV }} --tasks=$WORKER_ARN --query="tasks[0].containers[0].image" --output=text)
241-
WORKER_VERSION=${WORKER_IMAGE#*:}
240+
WORKER_IMAGE=$(aws ecs describe-tasks --cluster=bcda-${{ env.RELEASE_ENV }} --tasks=$WORKER_ARN --query="tasks[0].containers[?name == 'worker'].image" --output=text)
241+
WORKER_VERSION=${WORKER_IMAGE##*:}
242242
if [[ $WORKER_VERSION != ${{ inputs.version }} ]]; then
243243
echo "BCDA Worker expected release version: ${{ inputs.version }} did not match AWS version: ${WORKER_VERSION}."
244244
exit 1
@@ -292,8 +292,8 @@ jobs:
292292
run: |
293293
aws ecs wait services-stable --cluster bcda-${{ env.RELEASE_ENV }} --services bcda-${{ env.RELEASE_ENV }}-api
294294
API_ARN=$(aws ecs list-tasks --cluster=bcda-${{ env.RELEASE_ENV }} --service-name=bcda-${{ env.RELEASE_ENV }}-api --query 'taskArns[0]' --output text)
295-
API_IMAGE=$(aws ecs describe-tasks --cluster=bcda-${{ env.RELEASE_ENV }} --tasks=$API_ARN --query="tasks[0].containers[0].image" --output=text)
296-
export API_VERSION=${API_IMAGE#*:}
295+
API_IMAGE=$(aws ecs describe-tasks --cluster=bcda-${{ env.RELEASE_ENV }} --tasks=$API_ARN --query="tasks[0].containers[?name == 'api'].image" --output=text)
296+
export API_VERSION=${API_IMAGE##*:}
297297
python3 scripts/mark_deployment.py \
298298
--app_id ${{ env.NEWRELIC_APP_ID }} \
299299
--api_key ${{ env.NEWRELIC_API_KEY }} \

0 commit comments

Comments
 (0)