Capistrano with pairing stations

written by paul on July 19th, 2008 @ 02:31 PM

My last few projects have all been developed on mac minis. We have them set up as pairing stations, with two people to a machine. Every machine was cloned from the original (or an image), so each station is just like every other.

Over time, machines need maintenance. For example, one pair realizes that we need to upgrade a gem. In order to keep the machines in sync, that pair would either ssh to every pairing station and perform the upgrade, or else ask each pair to do it themselves.

Instead of this manual process, we came up with a capistrano task to launch a shell on every machine. Now, we can run commands on every pairing station at the same time.


task :pairing_stations do
  ENV["HOSTS"] = "10.1.0.12, 10.1.0.13" 
  shell
end

For example, we can check which version of rake is installed on our pairing stations and make sure that they are all up to date:


% cap pairing_stations
  * executing `pairing_stations'
  * executing `shell'
====================================================================
Welcome to the interactive Capistrano shell! This is an experimental
feature, and is liable to change in future releases. Type 'help' for
a summary of how to use the shell.
--------------------------------------------------------------------
cap> gem list | grep rake
[establishing connection(s) to 10.1.0.12, 10.1.0.13]
 ** [out :: 10.1.0.12] rake (0.7.3)
 ** [out :: 10.1.0.13] rake (0.8.1)
cap> gem update rake

Comments

  • Josh Cronemeyer on 21 Jul 11:51

    That is a great idea. Another approach to this, assuming a debian based pairing station (we use ubuntu), is to create debian metapackages (.debs) Then you can just do apt-get install pairing-station or some such. The problem becomes maintaining the packages and the team's local repository, but they are nice to have both for maintenance and for setting up new pairing machines.
  • Wes Maldonado on 21 Jul 20:54

    We use "geminstaller":http://geminstaller.rubyforge.org/ to keep our gems up to date on a per project basis where we might be going from pairing station to paring station on different project with different gem requirements. We use a base system image that runs nightly update scripts to update the all the workstations if we need to make system wide upgrades. I do like the idea of keeping thing simple in those places where you have a handful of systems, check out geminstaller though, you can run it via rake/cap so it could be useful to you.

Post a comment

Options:

Size

Colors