[Bamboo Knowledge Base]
You can use Bamboo to deploy and manage your Java web application with Tomcat 6 or 7, without having to directly interact with Maven, Ant or write special scripts.
Bamboo provides tasks that use the HTTP-based scripting interface to the Tomcat Manager application that ships with Tomcat. You can use the Bamboo tasks to perform the following Tomcat operations:
Each of these tasks run as part of a Bamboo job.
On this page :
Related pages:
Atlassian blogs:
You will need to prepare the Tomcat server before Bamboo can manage and deploy applications to it.
Download the Tomcat 7 distribution and unzip it on your file system.
Add a new Tomcat user for Bamboo to use the Tomcat Application Manager by adding the following line in conf/tomcat-users.xml
between the <tomcat-users>
tags:
<user username="bamboo" password="bamboo" roles="manager-script,manager-gui"/>
bin/startup.sh
on Linux or Mac, or bin/startup.bat
on Windows.You use Tomcat deployment tasks in the context of a job in a build plan in Bamboo. This plan should generate a deployable artifact, such as a WAR file. To deploy the artifact, you add a Tomcat deploy task to the plan, as follows:
Configure the Tomcat task settings, as described below.
Click Save.
To deploy the application, simply run the plan.
You can check that the deployment has been successful by:
Navigating to the logs for the job. Towards the end you should see something like:
> Deploying application with war file ‘target/tomcat-test-0.1.war’ to context ‘/myapp’ to server [http://localhost:8080/manager/](http://localhost:8080/manager/) > Application was successfully deployed.
This indicates that Bamboo completed the task successfully.
Now, browse to the expected address for your application. You should see the welcome page.
The Tomcat Deploy, Start, Stop, Undeploy and Reload tasks each make use of some or all of the following configuration settings:
Task Description | To help you to identify the task. |
Disable this task | Check, or clear, to selectively run this task. |
Tomcat Manager URL | The URL for the Tomcat Manager e.g. http://localhost:8080/manager/ |
Target Tomcat server is version 6.x | Choose this if deploying to a Tomcat 6.x server. |
Tomcat Manager Username and Password | These should match the credentials set in conf/tomcat-users.xml when you configured Tomcat, as described above. |
Application Context | Specifies where the application should sit on the Tomcat server once deployed. |
WAR File | The path to the WAR file, relative to the Bamboo working directory, for example “target/tomcat-test-0.1.war” |
Deployment Tag | The value used to tag the deployment within the Tomcat Manager. You can use Bamboo variables to build the tag value. For example, using the value ${bamboo.buildResultKey} will tag the deployment with the build number of the build that was used to deploy the application. |