Skip to content

Commit 3985404

Browse files
authored
fix: handle missing ECS deployment gracefully when replaced (#20)
* feat: Handle missing ECS deployment gracefully when replaced by external redeploy * feat: refine message
1 parent d142866 commit 3985404

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

deploy.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ function pollForSpecificServiceUpdate() {
6969
while true; do
7070
RESPONSE=$(describeService)
7171
DEPLOYMENT=$(echo "$RESPONSE" | jq -r --arg deploymentId "$1" '.services[]?.deployments[] | select(.id==$deploymentId)')
72+
73+
if [ -z "$DEPLOYMENT" ]; then
74+
echo -e "${ORANGE}Deployment with ID $1 was cancelled, missing or replaced by another.";
75+
echo -e "${ORANGE}Exiting polling loop. Please verify deployment status in the AWS Console."
76+
exit 0;
77+
fi
78+
7279
DESIRED_COUNT=$(echo "$DEPLOYMENT" | jq -r '.desiredCount // 0')
7380
RUNNING_COUNT=$(echo "$DEPLOYMENT" | jq -r '.runningCount // 0')
7481
PENDING_COUNT=$(echo "$DEPLOYMENT" | jq -r '.pendingCount // 0')

0 commit comments

Comments
 (0)