Skip to content

Commit adc146d

Browse files
committed
feat: Handle missing ECS deployment gracefully when replaced by external redeploy
1 parent d142866 commit adc146d

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 could not be found. Likely replaced by a manual or external deployment.";
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)