SwitchTower with multiple repositories

I’d like to get SwitchTower to checkout from different repositories
per role? The db role checks out different stuff from the app role,
etc.

I don’t mind redefining SwitchTower::SCM::Subversion.checkout. But
I’m not sure the best way to do it. How would that method
parameterize the repository based on role? It’d be something like
this:
command = “#{svn} #{op} -q -r#{get_revision(role)}
#{get_repository(role)} #{actor.release_path} &&”

I would need to know what “role” is here, and would have to define the
get_revision and get_repository methods somewhere. Is there already a
way to do this? Or is there an easier approach?

FYI, the reason I’m being difficult is because I’m currently tasked
with managing the deployment of some java apps on different production
machines. SwitchTower will connect, get the latest jars from svn,
then restart jboss. Different machines need different jars from
different places in svn.

Hmmmm, maybe the best approach is to get it out of svn locally and
sftp it over. There’s a nice post at the bottom of this that is
helpful:
http://weblog.rubyonrails.org/articles/2006/01/02/switchtower-0-10-0.

-Tim

Tim,

It sounds like your needs are such that you might be better off just
writing your own deployment tasks. The SCM modules are pretty
specific in what they do and how they work, but you can easily do svn
checkouts without them, just using “run” to invoke svn with the
parameters you want. Of course, that does mean you’d have to work out
a system for naming and managing your deployment directories…

Otherwise, you’re going to have to implement your own SCM module that
is aware of multiple repositories. Not that it would be a difficult
solution–probably no more than 100 lines of Ruby, I’d imagine,
especially if you just subclass the Subversion module and reuse some
of the utility methods it provides.

  • Jamis