The maze book for programmers!
mazesforprogrammers.com

Algorithms, circle mazes, hex grids, masking, weaving, braiding, 3D and 4D grids, spheres, and more!

DRM-Free Ebook

The Buckblog

assorted ramblings by Jamis Buck

Capistrano 2.0

21 July 2007 — 2-minute read

I fully expect this announcement to be eclipsed by the far more world-shattering event of the release of Harry Potter #7, but I suppose it runs in the family. (I have a stagecoach robber in my family several generations back, whose pièce de résistance happened to coincide with the sinking of the Titanic.)

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.

Reader Comments

Jamis, you’re the man (probably not news to you). Anyway, just wanted to let you know how much we all appreciate your hard work on this amazing tool.

Thanks for a tool that makes our lives easier every day.

We already switched to the cap 2 preview 2 weeks ago and I experienced no problems so far. I think it’s safe to upgrade.

@Jamis and all other contributors: Nice job!

Awesome!!!

That is great news. Thank you.

I will be giving a presentation on capistrano 2 tomorrow now and this is great timing.

Also I ran into a problem deploying locally due to PATH issues, I managed to solve it and posted the solution here: http://rubyurl.com/rg6

Thank you!

Thank you so much! Sometimes when I’m bored, I’ve been known to spend hours perusing the ins and outs of your code (by the way, I love the logger class).

Thanks again, and take care!