capistrano - automate all the things
TRANSCRIPT
@THEREALBIFTER
John Cleary
Lead Developer at IntelliCentrics UK
x years PHP (where x > 10)
y years Ruby (where y < 2)
STAGES, ROLES & TASKS
Stages are the environments (can be multiple servers)
Roles are the jobs servers have, i.e. “I’m a database” == :db
Tasks are actions that we can perform on a server, e.g. deploy or restart apache (see cap -T)
GET CAPISTRANO
Ruby >= 1.9.3
gem install bundler
https://github.com/capistrano/capistrano
CONFIG THE SERVER(S)
create a deploy user
add them to the sudoers
ssh keys (add your key, add ssh key to git)
create the folder (/var/www/whatever)
MIGRATING TO CAPISTRANO
setup capistrano in a different folder
diff the folders
symlink the folder or edit apache/nginx config aka the ol’ switcheroo
SOME USEFUL TASKS
capistrano/drupal-deploy
capistrano/composer
capistrano/laravel
hipchat/hipchat-rb
seuros/capistrano-newrelic
AND FINALLY
linked_files and linked_dirs (for db passwords)
branch (ask or set)
hooks
works with svn too