Upgrading To Capistrano2
The Situation
You have been using Capistrano and the Railsmachine gem. You have your deployment working just the way you like it. Change is scary.
The Fix
Upgrading to Capistrano 2 is no big deal. The biggest change is the use of namespacing in tasks. Instead of cap deploy_with_migrations, you’ll use cap deploy:migrations. Most of the time you will still simply call ‘cap deploy’ to update your code.
- Get the latest capistrano and railsmachine gems
sudo gem install capistrano railsmachine
Note: You are no longer required to have mongrel or mongrel_cluster on your development system.
- Capify your project directory
capify .
- If you have any custom tasks, update them
task :after_deploy, :roles => :app do # ... end
might become this
namespace :custom do
task :update, :roles => :app do
# ...
end
end
after :deploy,"custom:update"
That’s it!
Be sure to commit your changes to Subversion. Run ‘cap -T’ to view the full list of tasks.
