JBoss.orgCommunity Documentation

Chapter 17. The torquebox Command

17.1. torquebox deploy
17.2. torquebox undeploy
17.3. torquebox run
17.4. torquebox rails
17.5. torquebox archive
17.6. torquebox cli
17.7. torquebox env
17.8. torquebox list

When you install TorqueBox you get a torquebox command line utility that can be used to deploy and undeploy applications, start and stop the server, and more. Running torquebox without any arguments displays the help screen.

$ torquebox 
Tasks:
  torquebox deploy ROOT        # Deploy an application to TorqueBox
  torquebox undeploy ROOT      # Undeploy an application from TorqueBox
  torquebox run                # Run TorqueBox (binds to localhost, use -b to ov...
  torquebox rails ROOT         # Create a Rails application at ROOT using the...
  torquebox archive ROOT       # Create a nice self-contained application arc...
  torquebox cli                # Run the JBoss AS7 CLI
  torquebox env [VARIABLE]     # Display TorqueBox environment variables
  torquebox help [TASK]        # Describe available tasks or one specific task
  torquebox list               # List applications deployed to TorqueBox and ...  

Running torquebox deploy will deploy your current working directory as an application to TorqueBox. If provided with a ROOT path, such as torquebox deploy /path/to/my/app the command will deploy the application found at that path.

$ torquebox deploy myapp
Deployed: myapp-knob.yml
    into: /opt/torquebox/jboss/standalone/deployments 

ROOT can be directory containing the application you want to deploy, a -knob.yml file, a .knob archive, or any Java deployable artifact (.war, .ear, etc).


Just the opposite of torquebox deploy is torquebox undeploy [ROOT]. This command will undeploy your application from TorqueBox. Similar to deploying, running this with no arguments, will attempt to undeploy an application with the same name as the current working directory. Providing a name or path, will cause torquebox undeploy to attempt to undeploy an application with that name.


$ torquebox undeploy myapp
Attempting to undeploy myapp-knob.yml
Undeployed: myapp-knob.yml
      from: /opt/torquebox/jboss/standalone/deployments 

The torquebox run command will run the TorqueBox server. In development, this is similar to rails server.


The server will retain control of the console while it is running. To stop the server, simply send a SIGINT, typically by typing control-C.

The torquebox rails [ROOT] command creates a Rails application at ROOT using the TorqueBox Rails template, or applies the TorqueBox template to an existing Rails application at ROOT. As with other commands that take a ROOT argument, if ROOT is omitted, the command will operate on the current working directory.

$ torquebox rails /path/to/my/app # apply the TorqueBox Rails template to an app 

$ torquebox rails # Create a new Rails application in the current directory 

The torquebox archive [ROOT] command creates an application archive containing all of your application dependencies. The archive can be deployed to TorqueBox with the --deploy option or by hand after the archive file, known as a .knob, has been created by using torquebox deploy myapp.knob. If ROOT is omitted, the command will operate on the current directory.


The torquebox cli command runs the JBoss AS7 command line interface.

$ torquebox cli

The torquebox env [VARIABLE] command displays the TorqueBox environment variables TORQUEBOX_HOME, JBOSS_HOME and JRUBY_HOME. The optional VARIABLE argument can be one of these three values and will cause the command to display only that value.

$ torquebox env
TORQUEBOX_HOME=/opt/torquebox
JBOSS_HOME=/opt/torquebox/jboss
JRUBY_HOME=/opt/torquebox/jruby 

$ torquebox env JBOSS_HOME
/opt/torquebox/jboss 

The torquebox list command displays all applications currently deployed to torquebox and their deployement status (e.g. deployed, awaiting deployment, failed). that value.

$ torquebox list
cachetest
  Descriptor: /opt/torquebox/jboss/standalone/deployments/cachetest-knob.yml
  Status: deployed

$ torquebox deploy 
Deployed: myapp-knob.yml
    into: /opt/torquebox/jboss/standalone/deployments

$ torquebox list
cachetest
  Descriptor: /opt/torquebox/jboss/standalone/deployments/cachetest-knob.yml
  Status: deployed
myapp
  Descriptor: /opt/torquebox/jboss/standalone/deployments/myapp-knob.yml
  Status: awaiting deployment