add more builds

master
Thomas Riboulet 9 years ago
parent 2dd227e4f1
commit 7989f89202

@ -0,0 +1,16 @@
{
"AWSEBDockerrunVersion": "1",
"Authentication": {
"Bucket": "elasticbeanstalk-eu-west-1-598354601320",
"Key": "dockercfg"
},
"Image": {
"Name": "mcansky/sinatra_hello_sidekiq:<TAG>",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "80"
}
]
}

@ -0,0 +1,13 @@
FROM mcansky/base_ruby:2c7652fa95a2ab9419bb85e81a7c801ca6fa65d2
# Set environment variables.
ENV HOME /var/app
ENV RACK_ENV production
# Define working directory.
WORKDIR /var/app
RUN git clone https://github.com/mcansky/sinatra_hello.git /var/app
RUN cd /var/app; bundle install
CMD ["/usr/local/bin/foreman","run", "sidekiq","-d","/var/app"]

@ -7,7 +7,6 @@ machine:
dependencies:
pre:
- pip install awscli
- docker build -t mcansky/sinatra_hello:$CIRCLE_SHA1 .
test:
override:
@ -17,5 +16,9 @@ deployment:
hub:
branch: master
commands:
- docker build -t mcansky/sinatra_hello:$CIRCLE_SHA1 .
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- ./deploy.sh $CIRCLE_SHA1
- cp Sidekiq_Dockerfile Dockerfile
- docker build -t mcansky/sinatra_hello_sidekiq:$CIRCLE_SHA1 .
- ./sidekiq_deploy.sh $CIRCLE_SHA1

@ -0,0 +1,19 @@
# 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
Loading…
Cancel
Save