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
715 B
Bash
20 lines
715 B
Bash
# deploy.sh
|
|
#! /bin/bash
|
|
|
|
SHA1=$1
|
|
|
|
# Deploy image to Docker Hub
|
|
docker push mcansky/sinatra_hello_sidekiq:$SHA1
|
|
|
|
# Create new Elastic Beanstalk version
|
|
EB_BUCKET=elasticbeanstalk-eu-west-1-sidekiq
|
|
DOCKERRUN_FILE=$SHA1-Dockerrun.aws.json
|
|
sed "s/<TAG>/$SHA1/" < Sidekiq.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_sidekiq_eb2 \
|
|
--version-label $SHA1 --source-bundle S3Bucket=$EB_BUCKET,S3Key=$DOCKERRUN_FILE
|
|
|
|
# Update Elastic Beanstalk environment to new version
|
|
aws elasticbeanstalk update-environment --environment-name sinatraHelloSidekiq-env \
|
|
--version-label $SHA1
|