Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/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
Add Comment
Please, Sign In to add comment