Skip to content

Auto deploy symfony app with codeship.com and elastic beanstalk

Notifications You must be signed in to change notification settings

bats-dm/symfony-docker-deploy

 
 

Repository files navigation

Dockerized Symfony app!!

How to auto deploy test-green docker base symfony application to the Elastic Beanstalk

Presentation Slides

http://www.slideshare.net/redpilot/auto-deploy-symfony-app-with-codeship-and-elastic-beanstalk

first run

  • be sure that you install docker and docker-compose
  • clone the project
  • get in project folder
  • stop your local web server if any as our app takes the 80 port
  • build the containers docker-compose build
  • run the containers docker-compose up -d
  • check that's containers up docker-compose ps
  • install symfony vendors docker exec -ti symfony_app composer install
  • open browser http:/localhost/app_dev.php you should standard Symfony CAMP UA welcome screen
  • finally setup your own repository to push code back to the github.com for later auto deploy

sfcampua

configure codeship.com CI for test and auto deploy

  • I suppose you already have codeship.com account
  • connect your github.com account with codeship.com, then choose your version of this repo
  • configure project setup commands

codeship-setup

# <- this is a comment and won't be executed
# Feel free to delete all the comments and type in your own commands
# Each line is treated like a command that you execute in a local shell.
# i.e.: rvm use 2.2.2
# i.e.: bundle install
# Set Environment Vars for Symfony test
export SYMFONY_ENV=test
export SYMFONY__TEST_DATABASE_USER=$MYSQL_USER
export SYMFONY__TEST_DATABASE_PASSWORD=$MYSQL_PASSWORD
export SYMFONY__TEST_DATABASE_NAME=test
# Copy the parameters.yml.dist
cp app/config/parameters.yml.dist app/config/parameters.yml
# Install dependencies through Composer
composer install --prefer-source --no-interaction
# Clear Cache
php ./bin/console --env=test cache:clear
  • configure tests run commands

codeship-setup-tests

# <- this is a comment and won't be executed
# Feel free to delete all the comments and type in your own commands
# Each line is treated like a command that you execute in a local shell.
# i.e.: rvm use 2.2.2
# i.e.: bundle install
phpunit -c ./
  • push any changes in current README.md file to your repo, just for initiate CI tests run

codeship-test-run

Create application on Elastic Beanstalk

elastic-beanstalk

image

image

  • finally you should get successful application setup screen

elastic-beanstalk-app

Setup Elastic Beanstalk CLI on your local machine

Auto deploy your app

image

image

for Questions

  • for any questions create an issue

License

  • all what you can find at this repo shared under the MIT License

About

Auto deploy symfony app with codeship.com and elastic beanstalk

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 91.3%
  • HTML 8.7%