Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lupupaulsv/d1cff1e892eec0c2aab4dfcde2f9e463 to your computer and use it in GitHub Desktop.
Save lupupaulsv/d1cff1e892eec0c2aab4dfcde2f9e463 to your computer and use it in GitHub Desktop.
for i in $ids;
do
echo "Waiting for build ID $i"
echo "Debug information at https://us-west-2.console.aws.amazon.com/systems-manager/automation/execution/$i?region=us-west-2"
while true;
do
status=$(aws ssm get-automation-execution --automation-execution-id "$i")
if [[ $(echo "$status" | grep -i "status" | grep -i "failed") ]]; then
echo 'Build failed!'
exit 1
fi
if [[ $(echo "$status" | grep -i "imagestate" | grep -i "available") ]]; then
break
fi
echo -n "."
sleep 5
done
done
echo 'Build succeeded!'
INSTANCESTATES shutting-down'
+ [[ -n IMAGESTATE available ]]
+ break
+ echo 'Build succeeded!'
Build succeeded!
@lupupaulsv
Copy link
Author

ids=()
ids+=("$scheduler")
ids+=("$web")
ids+=("$admin")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment