Skip to content

Instantly share code, notes, and snippets.

@hotakasaito
Created November 13, 2015 11:32
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 hotakasaito/31e64303c632f6aa0325 to your computer and use it in GitHub Desktop.
Save hotakasaito/31e64303c632f6aa0325 to your computer and use it in GitHub Desktop.
OpsWorks Deploy Sample
#!/usr/bin/env bash
set -xe
INSTANCE_ID=***
APP_ID=***
for i in opsworks_cookbooks contents
do
zip -9r ${i}.zip $i
aws s3 cp ${i}.zip s3://***/***
done
aws opsworks --region us-east-1 create-deployment --stack-id $INSTANCE_ID --command "{\"Name\":\"execute_recipes\", \"Args\":{\"recipes\":[\"nginx\"]}}"
aws opsworks --region us-east-1 create-deployment --stack-id $INSTANCE_ID --app-id $APP_ID --command "{\"Name\":\"deploy\"}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment