Last active
November 18, 2017 01:27
-
-
Save whyvez/78ba92566c36bff456bad87e62f822a7 to your computer and use it in GitHub Desktop.
CircleCi ElasticBeanstalk deploy
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
#!/usr/bin/env bash | |
# USAGE: | |
# DEPLOYMENT_BUCKET=your-deployement-bucket APPLICATION_NAME=your-application-name ENVIRONMENT_NAME=your-environment-name bash ./deploy.sh | |
commit_sha=$(git rev-parse HEAD) | |
bundle_name=${commit_sha}.zip | |
zip -r -x=*node_modules* -x=*.git* $bundle_name * .[^.]* | |
aws s3 cp $bundle_name s3://${DEPLOYMENT_BUCKET} | |
aws elasticbeanstalk create-application-version \ | |
--application-name $APPLICATION_NAME \ | |
--version-label $commit_sha \ | |
--source-bundle S3Bucket="${DEPLOYMENT_BUCKET}",S3Key="${bundle_name}" \ | |
--region $AWS_REGION | |
aws elasticbeanstalk update-environment \ | |
--application-name $APPLICATION_NAME \ | |
--environment-name $ENVIRONMENT_NAME \ | |
--version-label $commit_sha \ | |
--region $AWS_REGION | |
rm $bundle_name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment