Cerberus + RVM (or, multiple Ruby installs)

28 views
Skip to first unread message

Matthew Krom

unread,
Jan 31, 2010, 7:35:31 PM1/31/10
to cerberusci
Hello Cerberus team,

I think the root of my question is, any way to tell Cerberus to run some shell initialization before a build?  But, let me give some context in case there's another avenue:

Let's say I have 2 (or more) versions of Ruby installed, and several projects on each configuration (for sake of argument, Ruby EE 1.8.7, and Ruby 1.8.6).

Can they all live in the same Cerberus space (single config, .cerberus area), and yet reference their respective Ruby installs?

As I see it, it's "simply" a matter of setting shell environment variables and paths to "rake", etc. 

In fact, I'm using RVM (http://rvm.beginrescueend.com) to manage these, which provides a simple command to set this all up
  rvm ruby-1.8.7%myproject
(the %myproject is optional, and switches gemsets--slick).  

I imagine I could run this in my crontab before running Cerberus.  But, this would force me to install multiple Cerberuses, once for each Ruby install.

Any way to tell Cerberus to run some shell initialization before a build?

Matt

--
matthe...@gmail.com
MW Krom LLC
Cambridge, MA

Craig Jolicoeur

unread,
Feb 1, 2010, 9:55:51 AM2/1/10
to cerbe...@googlegroups.com
Hi Matthew,

There is a basic ruby builder that you can use to build your project.
The ruby builder allows you to set an explicit path to your ruby
executable and then execute a ruby script. You also can include a
custom regexp to decide if the build was a success or failure since
your script will probably have custom output.

We have a user who builds Rails and a few other projects on 4 or 5
different versions of Ruby and this is the method he uses.

Take a look at the "builder options" section of
http://wiki.github.com/cpjolicoeur/cerberus/configuration

There is no need to have multiple versions of cerberus installed
though. You can use the same cerberus gem and just setup different
projects under cerberus for each version of Ruby you want to build off
of.

> --
> You received this message because you are subscribed to the Google Groups
> "Cerberus" group.
> To post to this group, send email to cerbe...@googlegroups.com.
> To unsubscribe from this group, send email to
> cerberusci+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/cerberusci?hl=en.
>

iconoclast

unread,
Mar 16, 2010, 4:15:55 PM3/16/10
to Cerberus
I've also been trying to get Cerberus to run with rvm. If it were
possible to specify a custom rake_path the same way you can specify a
custom ruby_path, it would solve this (rvm provides a rake wrapper for
each installed ruby version).
In the meantime, I was able to get something working by based on
Craig's suggestion of using the ruby builder and by passing rvm as the
"task". In case it's helpful to anyone, the builder portion of the
project config looks something like this:

builder:
ruby:
task: ~/.rvm/bin/rvm 1.8.7 rake some-rake-task

I setup a separate Cerberus project for each version of ruby in order
to track the status of each separately, but a single "cerberus
buildall" will build each with the appropriate ruby version as
configured.

-Michael

On Feb 1, 7:55 am, Craig Jolicoeur <cpjolico...@gmail.com> wrote:
> Hi Matthew,
>
> There is a basic ruby builder that you can use to build your project.
> The ruby builder allows you to set an explicit path to your ruby
> executable and then execute a ruby script.  You also can include a
> custom regexp to decide if the build was a success or failure since
> your script will probably have custom output.
>
> We have a user who builds Rails and a few other projects on 4 or 5
> different versions of Ruby and this is the method he uses.
>

> Take a look at the "builder options" section ofhttp://wiki.github.com/cpjolicoeur/cerberus/configuration


>
> There is no need to have multiple versions of cerberus installed
> though.  You can use the same cerberus gem and just setup different
> projects under cerberus for each version of Ruby you want to build off
> of.
>

> On Sun, Jan 31, 2010 at 7:35 PM, Matthew Krom <matthew.k...@gmail.com> wrote:
> > Hello Cerberus team,
> > I think the root of my question is, any way to tell Cerberus to run some
> > shell initialization before a build?  But, let me give some context in case
> > there's another avenue:
> > Let's say I have 2 (or more) versions of Ruby installed, and several
> > projects on each configuration (for sake of argument, Ruby EE 1.8.7, and
> > Ruby 1.8.6).
> > Can they all live in the same Cerberus space (single config, .cerberus
> > area), and yet reference their respective Ruby installs?
> > As I see it, it's "simply" a matter of setting shell environment variables
> > and paths to "rake", etc.
> > In fact, I'm using RVM (http://rvm.beginrescueend.com) to manage these,
> > which provides a simple command to set this all up
> >   rvm ruby-1.8.7%myproject
> > (the %myproject is optional, and switches gemsets--slick).
> > I imagine I could run this in my crontab before running Cerberus.  But, this
> > would force me to install multiple Cerberuses, once for each Ruby install.
> > Any way to tell Cerberus to run some shell initialization before a build?
> > Matt
>
> > --

> > matthew.k...@gmail.com

Reply all
Reply to author
Forward
0 new messages