Mission Capistrano: Accomplished
A couple of weeks ago, I accepted “Mission Capistrano” to automate the deployment process. I figure I owe an update: Well, it’s “Mission accomplished!”…all thanks to Capistrano.
![[2010-07-26] workbot](http://blog.kineticdiagrams.com/wp-content/uploads/2010/07/2010-07-26-workbot-e1280045000974-284x300.jpg)
(Photo by pasukaru76, Creative Commons license)
Meet Capistrano, my new unpaid and overworked robotic intern. Today, instead of dealing through multiple tedious steps, I simply type:
cap deploy
and Capistrano automatically takes care of the dirty work. What used to take 15 minutes now takes less than 4 seconds.
Here’s my 8-line configuration file…feel free to use it as a starting point for your projects:
set :application, "kinetic"
set :repository, "."
set :scm, :none
set :deploy_via, :copy
set :copy_exclude, [".DS_Store", "vendor"]
set :deploy_to, "/home/kinetic/kineticdiagrams.com/"
set :user, "kinetic"
role :app, "kineticdiagrams.com"
With Capistrano, I can painlessly to deploy to multiple servers in parallel. And my favorite feature is that I can roll-back to any previously-deployed version. Let’s say I accidentally deploy a bug in my application code and expose my gaffe to the world. With Capistrano, I can easily roll-back to an earlier working version
cap deploy:rollback
and continue with the rest of my day, dignity intact. If only my romantic relationships had a similar “undo” button…
