Friday, March 13, 2009

Deploying JRuby on Rails Exploded War to JBoss

I've been writing a lot of small apps in JRuby lately, packaging them with warbler and deploying them to JBoss.  These war files average around 10MB I am usually working remotely so these take a few minutes to upload via my 4 mbps/512 kbps ADSL.   Occasionally for small stuff I cheat and edit the code directly on the server so that I don't have to upload the entire war just to change one file.

In addition to the typical compressed war files JBoss allows for applications to be deployed as an exploded directory.  That makes it even easier to modify the application on the fly.

The only issue I've found with this is that I have to be a bit more careful to  manually ensure that the deployed application is in sync with my local workspace.  One way I've been doing that is to use 
xcopy /d
which copies only those files whose source time is newer than the destination time.

Using a revision control system (we use subversion or mercurial) for these projects and deploying from it would probably take care of this but there are two reasons I haven't been doing that up until now.
  • The guys who do the front end design don't use revision control so I keep having to manually apply their changes.  It's more efficient if I can just point them to the css, images, and rhtml files on the server.
  • These projects are very small and temporary.  Some of them only take a couple of hours to implement.  It often seems like unnecessary overhead to create the whole Trac + Subversion/Mercurial projects for them until they become more permanent.
However, I do need to sort this out before someones changes get overwritten so I think I'm going to try and get them to use tortoiseSVN and make a script that deploys the latest revision to the exploded directory. That should let me deploy almost as quickly as I do now but still take care of the synchronization issue.

No comments: