On Wednesday Jamis Buck released a preview of the upcoming Capistrano 2.0. For those not familiar with Capistrano yet, it is a framework for automating tasks via SSH on remote servers. Use it for everything from software installation and application deployment to configuration management and ad hoc server monitoring. It is a fantastic piece Ruby workmanship and the single most useful Ruby utility in my toolbox.
There are a few gotchas if you’re upgrading from 1.x which Jamis outlines at the new home of Capistrano, capify.org. Nothing in the list is a deal breaker. After reading through the new feature set it’s clear that Jamis has been working hard to make Capistrano operate with fewer assumptions about what you’re trying to do with it.
Capistrano (born Switchtower) was created with the specific intention of relieving the pain 37signals felt when deploying their Rails based products. Thus it made several assumptions that, by default, anticipated a Rails setup. No longer. Instead of looking for a deployment recipe (config/deploy.rb),
“Capistrano 2.0 will now look for the capfile first in the current working directory, and if it does not locate it there, it will continue to search up the directory tree until it either reaches the root directory, or finds a Capfile. This means you can now invoke cap from anywhere within your project tree, and have it find your project Capfile.”
I still sit there staring at the terminal with a huge grin on my face each time I run ‘cap deploy’. Take it to the next level and get Capistrano 2.0 Preview 1 with:
gem install -s http://gems.rubyonrails.com capistrano
Jamis is soliciting feedback on Capistrano 2.0 in the Capistrano mailing list.
