Skip to content

Commit 14261ff

Browse files
authored
Merge pull request #44 from CGC-2026/hotfix/cloud-infra
yml changes
2 parents fd9f3e9 + 2e75de5 commit 14261ff

1 file changed

Lines changed: 33 additions & 1 deletion

File tree

.github/workflows/deploy.yml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,37 @@ jobs:
9595
--query 'Command.CommandId' \
9696
--output text)
9797
98+
echo "Waiting for SSM command ${COMMAND_ID} to complete..."
99+
for i in {1..60}; do
100+
STATUS=$(aws ssm get-command-invocation \
101+
--region "${AWS_REGION}" \
102+
--command-id "${COMMAND_ID}" \
103+
--instance-id "${EC2_INSTANCE_ID}" \
104+
--query 'Status' \
105+
--output text 2>/dev/null || echo "Pending")
106+
107+
case "${STATUS}" in
108+
Success)
109+
echo "SSM command succeeded"
110+
break
111+
;;
112+
Failed|Cancelled|TimedOut)
113+
echo "SSM command failed with status: ${STATUS}"
114+
aws ssm get-command-invocation \
115+
--region "${AWS_REGION}" \
116+
--command-id "${COMMAND_ID}" \
117+
--instance-id "${EC2_INSTANCE_ID}" \
118+
--query 'StandardErrorContent' \
119+
--output text
120+
exit 1
121+
;;
122+
*)
123+
echo "Status: ${STATUS} (attempt $i/60)"
124+
sleep 5
125+
;;
126+
esac
127+
done
128+
98129
- name: Verify health
99130
run: |
100131
set -euo pipefail
@@ -119,4 +150,5 @@ jobs:
119150
sleep 3
120151
done
121152
122-
echo "Health check failed"
153+
echo "Health check failed"
154+
exit 1

0 commit comments

Comments
 (0)