Created
October 29, 2021 04:10
-
-
Save jared-christensen/a5ed20c6fb27539bce5fb351e7cccbd5 to your computer and use it in GitHub Desktop.
Wait for AWS AppRunner deploy to succeed for CodeBuild step in CodePipeline
This file contains hidden or 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
#!/bin/bash | |
ARN=$1 | |
echo "- ARN: $ARN" | |
OPERATION="" | |
STATUS="" | |
while [ "$STATUS" != "SUCCEEDED" ] | |
do | |
OPERATION=$(aws apprunner list-operations --service-arn "$ARN" --output text | grep -m1 "") | |
STATUS=$(echo $OPERATION | grep -oE "PENDING|IN_PROGRESS|FAILED|SUCCEEDED|ROLLBACK_IN_PROGRESS|ROLLBACK_FAILED|ROLLBACK_SUCCEEDED") | |
echo "- STATUS: $STATUS" | |
if [ "$STATUS" != "PENDING" ] && [ "$STATUS" != "IN_PROGRESS" ] && [ "$STATUS" != "SUCCEEDED" ] | |
then | |
echo "- OPERATION: $OPERATION" | |
exit 1 | |
fi | |
sleep 1 | |
done |
Very useful, thanks @stokedout . I removed the hard-coded region but other than that works well for me!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Doesn't seem to work anymore since the next token is at the top of the text, I adapted it to this: