(I know I'm resurrecting an old thread, but...)

On Sep 22, 2:45 am, puschkin <[email protected]> wrote:
> Is there a way to build a war file using warbler and deploying this
> file to a server by Capistrano?

We're building a WAR for our Rails app and deploying it with
Capistrano.

- Our build machine invokes Warbler's Rake task
- Warbler builds the WAR file into artifacts/app.war

When someone wants to deploy, there's a button on the build machine
that runs `cap deploy`.
The standard Capistrano deployment recipe needed just a couple of
tweaks to work for our situation:

    namespace :deploy do
      task :update_code, :roles => :app do
        on_rollback { run "rm -rf -- \"#{release_path}\"" }

        create_tomcat_directory_structure_under release_path
        source_war_path = "artifacts/#{war_filename}"
        target_war_path = File.join(release_path, 'webapps',
war_filename)
        top.upload source_war_path, target_war_path
      end

      task :finalize_update do
        # no finalization necessary with a WAR deployment
      end
    end

The `update_code task` uploads the WAR to somewhere useful, and the
`finalize_update` task need to doesn't do anything -- our per-release
Tomcat directory structure already has links pointed at the
appropriate shared directories.

I extracted our Tomcat deployment recipe into a gem called capistrano-
tomcat[1] but the main part of it is simply those two overrrides.


[1] https://github.com/rhunter/capistrano-tomcat


--
Rob Hunter

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to [email protected]
* To unsubscribe from this group, send email to 
[email protected] For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Reply via email to