Guest User

Untitled

a guest
Nov 19th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. # USAGE:
  4. # DEPLOYMENT_BUCKET=your-deployement-bucket APPLICATION_NAME=your-application-name ENVIRONMENT_NAME=your-environment-name bash ./deploy.sh
  5.  
  6. commit_sha=$(git rev-parse HEAD)
  7. bundle_name=${commit_sha}.zip
  8.  
  9. zip -r -x=*node_modules* -x=*.git* $bundle_name * .[^.]*
  10.  
  11. aws s3 cp $bundle_name s3://${DEPLOYMENT_BUCKET}
  12.  
  13. aws elasticbeanstalk create-application-version \
  14. --application-name $APPLICATION_NAME \
  15. --version-label $commit_sha \
  16. --source-bundle S3Bucket="${DEPLOYMENT_BUCKET}",S3Key="${bundle_name}" \
  17. --region $AWS_REGION
  18.  
  19. aws elasticbeanstalk update-environment \
  20. --application-name $APPLICATION_NAME \
  21. --environment-name $ENVIRONMENT_NAME \
  22. --version-label $commit_sha \
  23. --region $AWS_REGION
  24.  
  25. rm $bundle_name
Add Comment
Please, Sign In to add comment