Simple JavaEE6 app to test deployment with Capistrano
#If you are a Java programmer
- Install Ruby using RVM or RBENV (Ruby 1.9.3 is preferred)
- Run "gem install capistrano"
- Go to your Java project root directory and run "capify"
- This will create the capistrano config file.
- Copy the contents of this project's config/deploy.rb to your config/deploy.rb
- Change the variables file according to your machine
- Make sure Tomcat is running
- Make sure Tomcat manager role/s are configured as given here - http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html#Configuring_Manager_Application_Access
In your tomcat-users.xml there should be something like -
user username="tomcat" password="tomcat" roles="manager-gui"
user username="tomcatt" password="tomcatt" roles="manager-script"
Finally - Run "cap local deploy"
To run a specific version "cap -S revision=FULL-GIT-SHA local deploy"
Note
You can use this project as a sample Java project to start things off
You can add more environments by editing the config/deploy.rb file and adding code like the "task :local do ... end" block