Capistrano and Glassfish
There is enough documentation when it comes to installing JRuby and Glassfish. What was lacking was a simple capistrano recipe to get you started, let’s get cracking.
1 2 3 4 5 6 7 | namespace :app do desc "Warble and Deploy" task :warble_and_deploy , :roles => [:app] do run "cd #{release_path}/ && warble" run "/bin/asadmin deploy --user admin --virtualservers #{virtual_server} --passwordfile /home/rails/passwordfile --contextroot / #{release_path}/#{warfile_name}" end end |
Now, that doesn’t look so hard does it? The recipe makes a few assumptions. First you will need to create a asadmin password file. To do so make a simple textfile with a simple string: “AS_ADMIN_PASSWORD=ieathashbrowniesonce”. The second thing is that we assume that your capistrano user has rights to access the warble gem.
Now all that is left is to define two extra capistrano variables. virtual_server is the virtualserver that your application is attached to and warfile_name the name of the warfile you are trying to deploy (as configured in your warble.rb file).
I’m not sure if this is actually the best way to deploy on glassfish using capistrano so if you know a better way please let me know.

December 4th, 2008 at 3:07 pm
[...] thanks to the BrightLight blog for providing the initial [...]