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.2.0 Preview

22 February 2008 — 2-minute read

Alright, I’m almost ready to unleash this monster on the world, but I’d like a few brave souls to kick the tires. Especially, if you use git or bzr with Capistrano, you might want to give this new version a spin, since it includes a few changes to those SCM modules.

Grab the latest beta gem thus:

gem install --source http://gems.rubyonrails.org capistrano

The significant changes in this release:

FEATURE: Thanks to James Duncan Davidson, Cap 2.2.0 will sport an additional way to define roles. If you have servers that overlap roles, this can DRY things up:


server "host.name", :web, :app

FEATURE: Rob Holland submitted a patch that makes cap play more nicely with very large numbers of servers. If you had too many, cap would bog down, and you may even get errors from having too many simultaneous connections. You can now specify a :max_hosts option, and if a task needs to operate on more than that number of servers at once, the server list will be chopped up and fed through the task in pieces.

FEATURE: David Masover gave us a way to define roles dynamically, by passing a block to the role macro:

1
2
3
role :app do
  ["host1", "host2"]
end

This means that if you have a recipe that knows the roles, but won’t know the hosts until runtime (think EC2 and such), you can more easily code for it.

GIT: The git SCM module has the following changes:

  • Distributed git support for better operability with remote_cache strategy
  • Use checkout instead of merge for git SCM [nuttycom]
  • Add support for :git_enable_submodules variable, to enable submodules with the git SCM

And, of course, there are quite a few other smaller changes, too. Check out the CHANGELOG for the full list.

So, kick the tires and report back. If all looks good by the middle of next week or so, we’ll see an official release.

Reader Comments

I just posted a quick fix for the git deploy/scm module. A rather crucial patch. [1] Looks to be some nice logical changes in the DCSM front.

[1] http://dev.rubyonrails.org/ticket/11202

I’m thrilled to see increasing capistrano support for Git. Great news!

Hey Jamis,

I had a query regarding the integration testing article on your blog… but that article probably has comments disabled… so posting it here.

I wanted to know the way to set session variables in integration tests… as in just to bypass login filters… so you do not have to deal with login altogether. Currently I tried the following…

get “user/something_to_initialize_sessions” session[:user_id] = user.id get “user/something_that_needs_a_session_variable_set”

And rails does not seem happy about it. I keep getting errors for the code above.

I have a CAS login filter on my controllers… so i am just trying to bypass it.

@akshay, no, you can’t access the session that way in integration tests. To be honest, it’s been a long time since I was in that code, so your best bet will be to read the source and see how things are done there.

Now, back to our regularly scheduled programming… :)

Git support for RubyForge isn’t too far out: http://rubyforge.org/tracker/index.php?func=detail&aid=15457&group_id=5&atid=104 Everybody’s gittin!

Whoa, cool news, Tom! I suppose I had better start learning git. :)