-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EPBR-6353 adds check service status build spec
This buildspec and shell script is to be used by the pipeline when rolling deployments are not enable. This enables the code pipeline to check the service has been successfully restarted before the next stage runs
- Loading branch information
1 parent
59641f4
commit 6484bf5
Showing
3 changed files
with
46 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
version: 0.2 | ||
|
||
phases: | ||
pre_build: | ||
commands: | ||
- aws --version | ||
|
||
|
||
build: | ||
commands: | ||
- bash ./buildspec/assume_role.sh arn:aws:iam::$AWS_ACCOUNT_ID:role/ci-server this_profile | ||
- bash ./scripts/check_deployment_status.sh this_profile $CLUSTER_NAME $SERVICE_NAME | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
CLUSTER_NAME=$1 | ||
SERVICE_NAME=$2 | ||
|
||
|
||
# | ||
STATUS=$(aws ecs describe-services --services $SERVICE_NAME --cluster $CLUSTER_NAME | jq -rc '.services[0].deployments[0].rolloutState' ) | ||
##echo "${STATUS}" | ||
##if [[ $STATUS == "COMPLETED" ]]; then | ||
## echo "done" | ||
##fi | ||
#exit 0 | ||
|
||
while [[ $STATUS == "IN_PROGRESS" ]]; do | ||
STATUS=$(aws ecs describe-services --services $SERVICE_NAME --cluster $CLUSTER_NAME | jq -rc '.services[0].deployments[0].rolloutState' ) | ||
echo "${STATUS} << WAITING FOR RESTART STATUS TO REACH COMPLETED" | ||
sleep 20 | ||
done | ||
|
||
if [[ $STATUS == "COMPLETED" ]]; then | ||
echo "SERVICE RESTART HAS COMPLETED SUCCESSFULLY" | ||
exit 0 | ||
fi | ||
|
||
|
||
|
||
echo 'SERVICE RESTART HAS FAILED' | ||
exit 1 |