You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
694 B
Bash
20 lines
694 B
Bash
# deploy.sh
|
|
#! /bin/bash
|
|
|
|
SHA1=$1
|
|
|
|
# Deploy image to Docker Hub
|
|
docker push mcansky/sinatra_hello:$SHA1
|
|
|
|
# Create new Elastic Beanstalk version
|
|
EB_BUCKET=elasticbeanstalk-eu-west-1-598354601320
|
|
DOCKERRUN_FILE=$SHA1-Dockerrun.aws.json
|
|
sed "s/<TAG>/$SHA1/" < Dockerrun.aws.json.template > $DOCKERRUN_FILE
|
|
aws s3 cp $DOCKERRUN_FILE s3://$EB_BUCKET/$DOCKERRUN_FILE
|
|
aws elasticbeanstalk create-application-version --application-name sinatra_hello_eb1 \
|
|
--version-label $SHA1 --source-bundle S3Bucket=$EB_BUCKET,S3Key=$DOCKERRUN_FILE
|
|
|
|
# Update Elastic Beanstalk environment to new version
|
|
aws elasticbeanstalk update-environment --environment-name sinatra-hello-eb1-dev \
|
|
--version-label $SHA1
|