Application configured for automatic deployment to staging
environment at AWS EB thanks to Shippable.
Shippable run tests, build docker image, push image to hub.docker.com
and deploy image to EB staging
environment only if phpunit
tests passed.
Once QA guys confirm that all OK on staging
server, you can deploy it to production
EB environment.
Go to AWS > EB > Application > Application Versions
and manually deploy tested verion to EB production
environment.
- Install AWS CLI on Mac OSX:
sudo easy_install pip
pip --version # Check pip version
sudo pip install awscli
aws --version # Check aws cli version
- Configure AWS CLI:
Type aws configure
and put your AWS credentials and default region.
Currently we're using us-west-2
region.
- Run next command to deploy given to EB
production
environment:
bin/deploy.sh <VERSION>
For example:
bin/deploy.sh 23
Lets assume that:
- We named our virtual machine as
default
(docker-machine create --driver=virtualbox default
). - We added next line
eval "$(docker-machine env default)"
to~/.bashrc
, so docker can work properly on every terminal window (runsource ~/.bashrc
on current window to apply changes).
docker-compose up
ssh -L 8080:localhost:8080 -i ~/.docker/machine/machines/default/id_rsa docker@$(docker-machine ip default)
open http://localhost:8080
or
docker-compose up
open http://$(docker-machine ip default 2>/dev/null):8080