Swallow is a library that helps make it easier to deploy projects with Capistrano to AWS.
- Have systems create a new vanilla web image.
- Run
$ cap deploy:initto initialize the server. This will:- Install RBEnv (
rbenv:init)
- Install RBEnv (
- Copy the default
Capfilefrom the Swallow project to the project's root. - Copy the default
config/deploy.ymlto the project. - Copy and configure the default
config/newrelic.yml, or inconfig/deploy.ymlsetuse_newrelic: false. - Edit
deploy.ymlto match the project's needs. See the config section to get an understanding for what is needed and what is not. - If the project will use unicorn, follow the setting up unicorn instructions.
- Run
$ cap deploy:setupand select the targeted environment. This will:- Create the project's main directory structure
- Install the project's specified ruby version (
rbenv:setup_ruby) - Create the shared unicorn (
unicorn:setup_sockets_dir)
- Run
$ cap deploy:cold. This will:- Install the project's version of ruby if it's not already installed (
rbenv:setup_ruby) - Pull down the latest code from GitHub
- Properly link the standard shared directories to the project (i.e. /log, /tmp/pids)
- Link the unicron sockets directory (
unicorn:create_socket_dir) - Install bundler if its not already installed (
bundler:setup) - Install required gems (
bundler:install) - Copy over the database and any other config files (
deploy:copy_database_configurationanddeploy:copy_configs) - Create the project's deploy tag (
deploy:tag) - Copy previously generated & deployed assets if there are no asset changes, otherwise it will precompile & sync assets (
assets:check) - Run the airbrake & New Relic deploy notifications (
airbrake:notice_deploymentandnewrelic:notice_deployment) - Run the database migrations (
deploy:migrate)
- Install the project's version of ruby if it's not already installed (