Skip to content

Instantly share code, notes, and snippets.

@mfeldheim
Last active August 29, 2015 14:16
Show Gist options
  • Save mfeldheim/04d0276d6e586d825edc to your computer and use it in GitHub Desktop.
Save mfeldheim/04d0276d6e586d825edc to your computer and use it in GitHub Desktop.
#!/bin/sh
stackId=$1
appId=$2
echo "Waiting for OpsWorks deployment";
deploymentId=$(aws opsworks --region us-east-1 create-deployment --stack-id=$stackId --app-id=$appId --command "{\"Name\":\"deploy\"}" --comment="CircleCI test deploy" | grep "DeploymentId" | sed -E 's/.*": "([^"]+)".*/\1/g');
while [ $(aws opsworks --region us-east-1 describe-deployments --deployment-id=$deploymentId | grep "Status" | sed -E 's/.*Status": "([^"]+)".*/\1/g') = "running" ]; do
echo -ne "."; sleep 1;
done
echo "OpsWorks deployment finished"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment