Capistrano 2.0: Flexible Automated Deployment System
Capistrano is a deployment system written in Ruby by Jamis Buck. It has been the de facto standard for deploying Rails applications and automating remote tasks via SSH.
The recently released version 2.0 expands its usefulness not just for Rails developers, but for general automation tasks as well. New features include:
- Namespaces. Tasks may be defined within namespaces, nested arbitrarily deep. No more worrying of task name collision.
- Deployment strategies. Besides Subversion checkout, you can now specify other deployment strategies: export, copy, tar/gzip, etc.
- Opt-in deployment tasks. Deployment tasks are now opt-in; you don't get them, unless you ask for them.
- Event framework. Define hooks into other libraries easily.
- capify script. Autogenerate a minimal Capfile, and not just for Rails.
- Scoped execution. Scope a single invocation to a specific host, set of hosts, or role.
To install:
gem install capistrano
Capify your app:
capify .
Read Capistrano Basics for a quick start, and if you're a Rails developer, Using Capistrano with Rails. If you've used Capistrano 1.x before, be sure to read Upgrading to Capistrano 2.0.
Several useful Capistrano-related resources: (most are written with Capistrano 1.x in mind, but the concepts still apply to 2.0)
- Deploy Any Project Using Capistrano 2
- Using Capistrano to Deploy Django Apps
(Proof of concept that you can use Capistrano 2 not just with Rails) - Softies on Rails' Guide to Capistrano
- First Five Capistrano “Oh Crap! Oh No!” Tips
- Capistrano 2.0: Not Just for Rails
- Deploying with Capistrano to Amazon EC2
- Integrating Capistrano with Solaris SMF (Service Management Facility)
- Deploying with Capistrano on HostingRails.com
(a HostingRails-centric tutorial, but most of it may also apply to your web hosting provider) - Using Command Line Parameters with Rake and Capistrano
- Capistrano Rubyforge Project
Jamis has written more information over at the official Rails blog.
Pingback: Web 2.0 with Ruby on Rails