Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit deb0229

Browse files
committed
Fixed the while loop error and logic update
1 parent b0f0c60 commit deb0229

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

deploy.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ cd_deploy_status()
105105
echo "check tatusget info aws deploy get-deployment --deployment-id $DEPLOYID"
106106
counter=0
107107
DEPLOYMENT_STATUS=`aws deploy get-deployment --deployment-id "$DEPLOYID" | $JQ .deploymentInfo.status`
108-
while [[ $DEPLOYMENT_STATUS != "Succeeded" ]] || [[ $DEPLOYMENT_STATUS != "Failed" ]]
108+
while [[ "$DEPLOYMENT_STATUS" != "Succeeded" ]] || [[ "$DEPLOYMENT_STATUS" != "Failed" ]]
109109
do
110110
echo "Current Deployment status : $DEPLOYMENT_STATUS"
111111
echo "Waiting for 15 sec to check the Deployment status...."
@@ -117,7 +117,13 @@ cd_deploy_status()
117117
exit 1
118118
fi
119119
done
120-
echo "Deployment status is $DEPLOYMENT_STATUS"
120+
if [[ "$DEPLOYMENT_STATUS" = "Succeeded" ]] ;
121+
then
122+
echo "Deployment status is $DEPLOYMENT_STATUS"
123+
else
124+
echo "Deployment Failed. Please caheck AWS Code Deploy event logs"
125+
exit 1
126+
fi
121127

122128
}
123129
configure_aws_cli

0 commit comments

Comments
 (0)