Forum: Ruby on Rails SwitchTower with multiple repositories

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
54daaa5b481953b737e86861d94c53f4?d=identicon&s=25 Tim Harrison (Guest)
on 2006-02-09 02:53
(Received via mailing list)
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/....

-Tim
992fe8c19bbbc27f2b562a9f96efc03d?d=identicon&s=25 Jamis Buck (Guest)
on 2006-02-09 16:44
(Received via mailing list)
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
This topic is locked and can not be replied to.