|
|||||||||
|
|||||||||
DocumentationContainers
Get InvolvedFeeds
|
Cargo supports deploying to an already running container. This feature is called [Hot Deployment). You call it by using the ( Note that you can also do static deployment by simply defining the deployables to deploy in the
Using a local deployerA local deployer is a deployer that deploys deployables on a Local Container (i.e. a container installed on the same machine where the deployer is executing). Thus you'll need to use a local container id in Example of doing a local deploy to an existing configuration: [...]
<configuration>
<!-- Container configuration -->
<container>
<containerId>resin3x</containerId>
<home>c:/apps/resin-3.0.9</home> or
<zipUrlInstaller>
<url>http://www.caucho.com/download/resin-3.0.9.zip</url>
<downloadDir>${project.build.directory}/downloads</downloadDir>
<extractDir>${project.build.directory}/extracts</extractDir>
</zipUrlInstaller>
</container>
<!-- Configuration to use with the container -->
<configuration>
<type>existing</type>
<properties>
[...]
</properties>
</configuration>
<!-- Deployer configuration -->
<deployer>
<type>local</type>
</deployer>
<!-- Deployables configuration -->
<deployables>
<deployable>
<groupId>war group id</groupId>
<artifactId>war artifact id</artifactId>
<type>war</type>
<properties>
<context>optional root context</context>
</properties>
<pingURL>optional url to ping to know if deployable is done or not</pingURL>
<pingTimeout>optional timeout to ping (default 20000 milliseconds)</pingTimeout>
</deployable>
<deployable>
<groupId>ear group id</groupId>
<artifactId>ear artifact id</artifactId>
<type>ear</type>
<pingURL>optional url to ping to know if deployable is done or not</pingURL>
<pingTimeout>optional timeout to ping (default 20000 milliseconds)</pingTimeout>
</deployable>
[...]
</deployables>
</configuration>
[...]
As for the Using a remote deployerA remote deployer is a deployer that deploys deployables on a Remote Container (i.e. a container that is running and that has been started externally from Cargo). Thus you'll need to use an id for a remote container in Example of doing a remote deploy using a runtime configuration: [...]
<configuration>
<!-- Container configuration -->
<container>
<containerId>tomcat6x</containerId>
<type>remote</type>
</container>
<!-- Configuration to use with the container -->
<configuration>
<type>runtime</type>
<properties>
<cargo.remote.username>username</cargo.remote.username>
<cargo.remote.password>password</cargo.remote.password>
</properties>
</configuration>
<!-- Deployer configuration -->
<deployer>
<type>remote</type>
</deployer>
<!-- Deployables configuration -->
??<deployables>
<deployable>
<groupId>war group id</groupId>
<artifactId>war artifact id</artifactId>
<type>war</type>
<properties>
<context>optional root context</context>
</properties>
<pingURL>optional url to ping to know if deployable is done or not</pingURL>
<pingTimeout>optional timeout to ping (default 20000 milliseconds)</pingTimeout>
</deployable>
[...]
</deployables>
</configuration>
[...]
As you can see the information to connect and do the deployment to the remote container is specified in the runtime configuration ( Here's an another example, this time deploying the current project's artifact to a running JBoss 4.2.x container using a default 8080 port and default authorizations: [...]
<configuration>
<container>
<containerId>jboss42x</containerId>
<type>remote</type>
</container>
</configuration>
[...]
Just type Handling of deployment or undeployment failuresIf the deployment, undeployment or redeployment is done without any watchdog, CARGO will rely on the error codes return by the container's deployer to detect failures. This is sometimes not desired: for example, if one calls To work around the issue, make sure you define your deployable together with a watchdog. For example: Deployable with a ping URL <deployables>
<deployable>
<location>${project.build.directory}/${project.build.finalName}.${project.packaging}</location>
<pingURL>http://localhost:${servlet.port}/mycontext/index.html</pingURL>
</deployable>
</deployables>
In that case:
This functionality is available in the Java API, ANT tasks and Maven2/Maven3 plugin. |
||||||||
| |||||||||