-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdeploy.sh
22 lines (18 loc) · 964 Bytes
/
deploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
aws deploy push --application-name $APPLICATION_NAME --s3-location s3://$AWS_S3_BUCKET/$APPLICATION_NAME/$CI_JOB_ID.zip
ID=$(aws deploy create-deployment --application-name $APPLICATION_NAME --deployment-group-name $DEPLOYMENT_GROUP_NAME --s3-location bucket=$AWS_S3_BUCKET,key=$APPLICATION_NAME/$CI_JOB_ID.zip,bundleType=zip --output text --query '[deploymentId]')
STATUS=$(aws deploy get-deployment --deployment-id $ID --output text --query '[deploymentInfo.status]')
while [[ $STATUS == "Created" || $STATUS == "InProgress" || $STATUS == "Pending" || $STATUS == "Queued" || $STATUS == "Ready" ]]; do
echo "Status: $STATUS..."
STATUS=$(aws deploy get-deployment --deployment-id $ID --output text --query '[deploymentInfo.status]')
sleep 10
done
if [[ $STATUS == "Succeeded" ]]; then
EXITCODE=0
echo "Deployment finished."
else
EXITCODE=1
echo "Deployment failed!"
fi
aws deploy get-deployment --deployment-id $ID
exit $EXITCODE