Igor Artamonov
Igor Artamonov

Reputation: 35961

Simple Java-based deployment tool

I'm looking for a very simple deployment tool for JVM projects (Java, Spring, Grails, etc), with following features:

Should be something like:

$ deploytool staging deploy 
$ deploytool staging rollback

or

$ mvn deploytool:deploy -P staging
$ mvn deploytool:rollback -P staging

Basically it's just a:

  1. compile + test + build archive
  2. create 'date' directory on server (/.../application/version-%date%/)
  3. upload WAR content into this directory, from local maching
  4. update symlink from previous (/.../application/current/ -> /.../application/version-%date%/
  5. restart tomcat (sudo service tomcat7 restart)
  6. delete directory with oldest version (keep only last 5 versions, or versions for last 45 days)
  7. if something is wrong - update symlink to previous version (and restart tomcat)

I've taken a look at Puppet and JClouds, but seemst that it's different thing, more about cluster configuration, not deployment. Currently i'm using Ruby Capistrano for one project, and bash scripts for another. Capistrano is good, but requires installation of rvm, ruby, gems, etc, it's not working well for non-ruby team, and requires a lot of customizations for java project.

So, i'm wondering, is there any Capistrano-like tool for Java/JVM projects?

Upvotes: 2

Views: 463

Answers (1)

Andriy Plokhotnyuk
Andriy Plokhotnyuk

Reputation: 7989

  1. Use maven-compiler-plugin, maven-surefire-plugin and maven-war-plugin to build
  2. Use buildnumber-maven-plugin to create property with current timestamp value
  3. Use wagon-maven-plugin with generated timestamp value to upload war to staging server
  4. Use sshexec-maven-plugin to start shell scripts which will restart tomcat with application for selected version

Upvotes: 2

Related Questions