jenkins the definitive guide

(Jeff_L) #1

may need to build from a given SCM revision, as discussed for Subversion in Section 10.2.4, “Building
from a Subversion Tag”.


12.3.1.1. Using the Deploy plugin


If you are deploying to a Tomcat, JBoss, or GlassFish server, the most useful tool at your disposition will
probably be the Deploy plugin. This plugin makes it relatively straightforward to integrate deployment
to these platforms into your Jenkins build process. If you are deploying to IBM Websphere, you can
use the Websphere Deploy plugin to similar ends.


Let’s see how this plugin works in action, using the simple automated build and deployment pipeline
illustrated in Figure 12.1, “A simple automated deployment pipeline”.


Figure 12.1. A simple automated deployment pipeline


Here, the default build (gameoflife-default) runs the unit and integration tests, and builds a
deployable binary in the form of a WAR file. The metrics build (gameoflife-metrics) runs
additional checks regarding coding standards and code coverage. If both these builds are successful,
the application will be automatically deployed to the test environment by the gameoflife-deploy-
to-test build job.


In the gameoflife-deploy-to-test build job, we use the Copy Artifact plugin to retrieve the WAR file
generated in the gameoflife-default build job and copies it into the current build job’s workspace
(see Figure 12.2, “Copying the binary artifact to be deployed”).


Figure 12.2. Copying the binary artifact to be deployed

Free download pdf