Deployment task in jruby on rails

Hi,

I’m new to this list, so hello everyone. I’m László Bácsi from Hungary,
where I work for Virgo Systems as the lead ruby developer.

I have a problem that have bugged me for I while. The question is how to
deploy a rails application on the jruby platform as easily as it would
be
with capistrano on MRI. We need to deploy to Tomcat so packaging the
application in a war file and copying it to the server is no problem,
but
what about other deployment tasks like db migrations, putting up a
maintenance page, working with assets, etc.

If we used capistrano we would need a complete ruby environment on every
server with all the gems the application needs. And preferably this
should
be a jruby environment because of compatibility issues. This seems like
the
wrong approach here, because we already have the application with all of
its
dependencies bundled in a war.

I see two approaches that could work:

  1. Implement all of the special deployment tasks in a designated
    controller
    An action (or several actions) on this controller would be called
    after
    the war file is deployed. This could solve the db migration issues but
    it
    still wouldn’t be a good solution for tasks which need to do stuff on
    all
    the application servers. But there might be a way to call this action on
    specific servers. I think this could work and maybe all of this could be
    packaged in a Rails Engine (which is a new feature in Rails 2.3)
  2. Use one of the deployment solutions from the Java world
    I have no clue about this but it might be that there are great
    solutions
    for this kind of stuff in the Java world. I hear people talking about
    maven
    and the pieces I’ve put together from these conversations make me think
    that
    it could solve this issue. But that would need a lot of work.

What automating tools do you use for Rails deployment on the JRuby
platform?

Cheers,
LacKac

Hi,

I’ve been struggling with the same issue. As long as your application
can
start without the latest database schema, initiating a migration is as
simple as the following call:

ActiveRecord::Migrator.migrate(“db/migrate/”)

So I guess you could implement this in a controller. You could then
probably
fire it with a ServletContext lifecycle event if you’re sure your
migrations
cannot break anything. Wether that’s good practice, I doubt it.

I’m very curious too about the Java EE way of doing this. There must be
a
nice tool for this, though I’d like to keep our current ActiveRecord
migrations since we use these in our development, too.

Regards,

Martijn Storck

László Bácsi wrote:

what about other deployment tasks like db migrations, putting up a
I see two approaches that could work:
I have no clue about this but it might be that there are great
Cheers,
LacKac


View this message in context:
http://www.nabble.com/deployment-task-in-jruby-on-rails-tp21849203p21849689.html
Sent from the JRuby - User mailing list archive at Nabble.com.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

what about using a Hudson Task for this ?

On Thu, Feb 5, 2009 at 6:34 AM, Martijn S [email protected] wrote:

fire it with a ServletContext lifecycle event if you’re sure your migrations

application in a war file and copying it to the server is no problem, but

  1. Use one of the deployment solutions from the Java world

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email