Capistrano 1.4.0

Posted by Jamis on February 03, 2007 @ 12:17 PM

Today sees the release of Capistrano 1.4.0. Capistrano is a utility for executing commands in parallel on multiple machines, such as for automating the deployment of applications.

To install:

gem install capistrano

Version 1.4.0 fixes a few bugs, and adds a few features. The new features:

  • A “capture” helper has been added, to make it easy to capture the stdout of a remote command and return it as a string:

    result = capture(“uptime”)

  • A “get” helper has been added, to mirror the “put” command, letting you easily download files from a remote server to the local host. It will only download from the first server that matches the criteria for the current task. You must have Net::SFTP installed (gem install net-sftp) in order to use the “get” helper.

    get ”#{current_path}/log/production.log”, “logs/production.log”

  • Support for a system-wide config file has been added. If a file exists in ”/etc/capistrano.conf”, it will be loaded immediately after the standard recipe file is loaded, and immediately before any user-specific configuration.

The fixed bugs:

  • There used to be issues with cap hanging when running multiple capistrano instances at the same time when using gateways. This has been fixed.
  • The permissions tweaking in the standard recipe has been refactored into a separate task (set_permissions), which you can override if you are on a host that won’t let you set group-writable permissions.
  • The setup task now uses umask so that intermediate directories are created with the proper permissions.
  • Make sure the standard recipe loads first, so that .caprc and friends can oerride what it defines.
  • cold_deploy now calls update instead of deploy, to avoid invoking the restart task.
  • The ‘touch’ command in update_code now sets TZ to UTC for the duration of that command, so that asset timestamps are set correctly.
  • An off-by-one bug in the width computation for show_tasks has been fixed.

Minor deprecations:

  • The c/-caprc switch has been removed, since the new load order (standard, system, user, application) makes it meaningless.

Thanks to Mark Imbriaco, Neil Wilson, and Mike Bailey for their contributions to this release.

Update 4 Feb: Also thanks to Bojan Mihelac and Joshua Wehner for contributing patches (sorry I didn’t know your names earlier!).

Posted in Announcements

Comments

Have something to add? Click here to leave a comment.

03 Feb 2007

1. Duncan said...

Let me be the first to says thanks all! Capistrano makes software deployment a joy, and these updates just keep giving.

2. mano said...

thanks Jamis,

I use Capistrano but really can’t find a good or easy documentation besides the one on the rails manual (book 17) which I don’t know if it gets updated.

Any help with this? like for example, how to manage capistrano with sqlite projects? a good recipe to move/copy the sqlite to the ‘shared’ folder after deploy?

sorry, It might be just me

3. Jamis said...

mano, sadly, documentation is very, very lacking with Capistrano right now. I no longer have access to the rails manuals and so cannot update that book. I’m working on other documentation options, but my plate is very, very full at the moment.

Note, though, that capistrano+sqlite is beyond the scope of any manual I would write; it’s far too specific. Please feel free to join the Capistrano mailing list at Google groups. There are a lot of people there who would be more than willing to share advice on many different usage scenarios.

4. August Lilleaas said...

So, I created a Stikipad wiki:

http://capistrano.stikipad.com/documentation/

Posted about it in the group. Let’s hope we’ll get some proper docs soon.

04 Feb 2007

5. Mislav said...

“bmihelac” is Bojan Mihelac [1], a very active Core contributor; and jaw6 is Joshua Wehner [2].

[1] http://workingwithrails.com/person/6220-bojan-mihelac [2] http://workingwithrails.com/person/3231-joshua-wehner

p.s. WWR is sweet! :) helps you find people

6. Jamis said...

Thanks, Mislav. I’ve updated the announcement.