Capistrano 2.0

Posted by jamis July 22, 2007 @ 12:42 AM

Capistrano 2.0 is real. (What is Capistrano?)

Install it thus:

gem install capistrano

It’s been through four preview releases, and has seen significant changes since 1.4.1. If you’re currently using 1.4.1, be sure to check out the upgrade documentation at http://www.capify.org. If you’re altogether new to Capistrano, you might like to read about getting started.

Since the last preview release (number four, version 1.99.3), the changes are primarily bug fixes, but the following featureish modifications snuck in, too:

  • The uploader has added a tiny bit of sleep to prevent the CPU from going bonkers during uploads.
  • You can specify the $CAPISTRANO:HOST$ placeholder in the filenames that you give to “put”, and it will be replaced with the actual host that the file is being uploaded to.

Also, some people reported SFTP uploads were hanging for them. If this happens to you, try adding the following line to the top of your recipe file:

set :synchronous_connect, true

That will cause connections to the servers to be established serially, rather than in parallel, so if you’ve got a lot of servers that you are connecting to, it might make things a bit time-consuming. However, this appeared to work around the hanging SFTP issue.

You can read the complete changelog here. If you are using Capistrano at all, please also consider joining the mailing list, it’s a great place to share tips and report issues.

KNOWN ISSUES

Yes, there are a few of these. Two are of immediate significance:

  1. If you try to use the ‘put’ command to upload a file to two or more hosts via a gateway, you run a good chance of encountering “corrupted mac” errors. This is due to design flaws in Net::SSH and Net::SFTP, and (to my knowledge) cannot be worked around. The current best practice is to upload to a single host, and then use scp or rsync from the remote hosts to pull the file.
  2. A very few people have reported commands hanging inexplicably and infrequently. I suspect this is also due to flaws in Net::SSH, but I’m not certain yet.

Posted in Releases | 11 comments

Comments

  1. tobias luetke on 22 Jul 02:03:

    congrats jamis!

  2. tom brice on 22 Jul 02:16:

    Yes, congratulations! Capistrano is one of the best things to come out of rails. We are all (if I may speak for us all; it’s OK right?) are indebted to you for your excellent work of this indispensable tool.

  3. ynw on 22 Jul 15:27:

    Congrats!

  4. Egze on 22 Jul 15:38:

    The beta releases didn’t work on Windows XP. At least for me. Can anyone confirm that it works now?

  5. Edgardo Hames on 22 Jul 15:45:

    I came across the “corrupted mac” error last year. The problem was hardware related (the PCI bus speed was too fast for the Intel Gigabit Ethernet controller). I would like to send this feedback to the Capistrano developers but don’t know what would be the best way to do it.

  6. Jamis on 22 Jul 18:18:

    @Egze, I do not know if the gem has the same problems as before or not. If it does, the workaround I’ve recommended is to patch your Rubygems as mentioned here: http://tinyurl.com/yvuktb (a link to a post in the Capistrano mailing list at Google groups).

    @Edgardo, the Capistrano mailing list is always a good place to provide feedback.

  7. Tom on 24 Jul 02:16:

    Yeah are there any plans to make Capistrano work better in a Windows environment?

  8. Jamis on 24 Jul 02:44:

    @Tom, at the risk of sounding callous, I can with confidence state that I have absolutely no plans to ever make Capistrano able to talk to Windows machines. However, Capistrano works fine if you run it on Windows, talking to a Unix machine.

    That said, if anyone gets a hankering and manages to patch Capistrano such that it can talk to a Windows machine, I’d consider integrating it into Capistrano.

  9. Brian on 30 Jul 19:04:

    Jamis, I’m trying to use Capistrano 2.0 with Media Temple’s gridservers, and I appear to have a problem. I’m not sure what to do about it.

    I have the username set, which is the same for SSH and SVN, lets say something like:

    serveradmin%mydomain.com

    Everything seems to work fine, in the sense that I can get Cap2 to communicate with the Media Temple server, and even run their custom commands. In fact, I can run anything that just uses that username from the variable in my deploy.rb file.

    The problem lies when I try and run “cap deploy”. I get an error that the SVN repository refused connection to:

    serveradmin/272omain.com

    I can only assume that this has something to do with the ”%” sign in the username? I’ve tried a bunch of options, and nothing seems to work. Any ideas why this request is being generated?

    Thanks for your help, and Capistrano is fantastic.

  10. a5lyst6suh on 31 Jul 03:48:

    zy0tzy265w7fpn4 7vngnb1v9c8pqt jmwotfg0i7cpnttnr

  11. xuefeng8 on 17 Aug 04:25:

    Thanks for your help, and Capistrano is fantastic.

    Tomy