Capistrano 2.2.0

Posted by jamis February 28, 2008 @ 04:15 AM

Capistrano is a utility for managing remote servers and automating remote tasks. It is popularly used to deploy Rails applications (but can do oh, so much more!). Version 2.2.0 is now available (well, it’s released, anyway, you might need to wait for the file to propagate to the gem mirrors).

gem install capistrano

Version 2.2.0 sports the following changes:

FEATURE: Dynamic role definition. The role() method now accepts a block, which should return either a host name, a Capistrano::ServerDefinition object, an array of host names, or an array of Capistrano::ServerDefinition objects. This can be used to describe the servers in a role at runtime.

role :app do
  hosts = some_method_that_looks_up_the_current_hosts

FEATURE: Alternative server-centric role definitions, using the server() method:

role :app, "server" 
role :web, "server" 

# the above is the same as this:
server "server", :app, :web

FEATURE: Support for a :max_hosts option in tasks, that restricts the task so that it is only executed in hosts at a time, in chunks. This helps people who use Capistrano with very large numbers of servers, and prevents them running into connection caps and from running out of memory.

task :ping, :max_hosts => 100 do
  # anything here will only run against 100 hosts at a time

# alternatively, you can pass :max_hosts to the run command itself for
# finer granularity
task :pong do
  # this will run on ALL hosts at once
  run "something" 

  # this will run on no more than 100 hosts at a time
  run "something-else", :max_hosts => 100

ENHANCEMENT: Improved Git support!

ENHANCEMENT: Password prompt support in the Mercurial SCM.

ENHANCEMENT: Implement Bzr#next_revision so that pending changes can be reported correctly, and use checkout—lightweight instead of branch.

ENHANCEMENT: Bring back the :p4sync_flags and :p4client_root variables for perforce SCM.

Additionally, there are several minor bugs and typos that have been fixed. You can see the CHANGELOG for all the gory details.

As ever, please report bugs via the Rails trac, at And if you aren’t yet subscribed to the Capistrano mailing list, it’s where all the cool cappists hang out.

Posted in Releases | 5 comments


  1. loµis on 29 Feb 23:23:

    WOW …This are great News.but im not a friend of linux, i prefer windows. Can anybody tell me? why dont work capistrano on windows based Servers?or if anybody has a idea to make it posible … please tell me or paste a link here. Thanksss

  2. Alexey Kovyrin on 04 Mar 06:17:


    Actually it could work on windows servers. You just need ssh. Try to google and you’ll find many ssh implementations for windows (not sure what would you like to use, but I’m sure it is possible).

  3. Ken Collins on 04 Mar 14:29:

    Good work Jamis! I’ve very happy about the dynamic role definition as I was rolling my own way of doing that before. I’ll be having a great time today cleaning up my recipes and deploy strategies today to take advantage of the goodness in this release.

  4. Thomas on 04 Mar 14:30:

    I saw the mention in the last ADC mailer. What a great app. I just gave it a try on my server at and it worked like a charm.

  5. Christian on 18 Mar 16:31:

    thanks for this app. I am just starting out and had some trouble because of a lack of documentation for capistrano. but now i figured it out and works like a charm on my server

当前网页内容, 由 大妈 ZoomQuiet 使用工具: ScrapBook :: Firefox Extension 人工从互联网中收集并分享;
若有不妥, 欢迎评注提醒:


订阅 substack 体验古早写作:

点击注册~> 获得 100$ 体验券: DigitalOcean Referral Badge

关注公众号, 持续获得相关各种嗯哼:


关于 ~ DebugUself with DAMA ;-)
公安备案号: 44049002000656 ...::