NAME

Rex::Apache::Deploy::Tomcat - Deploy application to tomcat 6.

DESCRIPTION

With this module you can deploy WAR archives to Tomcat. Currently it works with Tomcat 6.

SYNOPSIS

use Rex::Apache::Deploy qw/Tomcat/;
  
context_path "/myapp";
   
task "dodeploy", "tc01", "tc02", sub {
   deploy "myapp.war",
      username => "manager",
      password => "manager",
      port     => 8080;
};

FUNCTIONS

deploy($file, %option)

This function deploys the given WAR archive. For that it will connect to the Tomcat manager. You have to define username and password for the Tomcat manager in the %option hash. If the Tomcat manager isn't available under its default location /manager you can also define the location with the manager_url option.

task "dodeploy", "tc01", "tc02", sub {
   deploy "myapp.war",
      username     => "manager",
      password     => "manager",
      manager_url  => "_manager",
      port         => 8080,
      context_path => "/foo";
};
context_path($path)

This function sets the context path for the application that gets deployed. This is a global setting. If you want to specify a custom context path for your application you can also do this as an option for the deploy function.

context_path "/myapp";