JBoss.orgCommunity Documentation

Chapter 18. TorqueBox Rake Support

18.1. Overview
18.2. Deploying applications
18.2.1. Directory-based deployments
18.2.2. Archive-based deployments
18.3. Undeploying applications
18.4. Server control

TorqueBox includes a support package which includes Rake tasks which assist in the deployment to and undeployment from an instance of the TorqueBox Server, in addition to the launching of the server. This rake-based support is normally intended for development-time usage, and not for production. More advanced tooling, such as Capistrano (see Capistrano Support) is advisable for production environments.

First, the $TORQUEBOX_HOME and $JBOSS_HOME variables must be set to the path of the top of your TorqueBox Installation and the JBoss installation inside of it, respectively, as described in Chapter 2, TorqueBox Installation.

$ export TORQUEBOX_HOME=/path/to/torquebox
$ export JBOSS_HOME=$TORQUEBOX_HOME/jboss

To include these tasks into your Rakefile, use a single require statement.

require 'torquebox-rake-support'

Once these variables are set and you have adjusted your Rakefile, you may perform directory- or archive-based deployments and control the execution of the TorqueBox AS.

To undeploy an application, either a directory- or archive-based deployment, a single command may be used:

...but we also support torquebox:undeploy:archive for symmetry's sake:

TorqueBox provides rake tasks for controlling the server.

$ cd $TORQUEBOX_HOME; jruby -S rake -T
(in /opt/torquebox)
rake torquebox:check            # Check your installation of the TorqueBox ...
rake torquebox:run              # Run TorqueBox server
rake torquebox:upstart:check    # Check if TorqueBox is installed as an ups...
rake torquebox:upstart:install  # Install TorqueBox as an upstart service
rake torquebox:upstart:restart  # Restart TorqueBox when running as an upst...
rake torquebox:upstart:start    # Start TorqueBox when running as an upstar...
rake torquebox:upstart:stop     # Stop TorqueBox when running as an upstart...
      

Note: The upstart:install task makes a couple of assumptions you need to take into account.