jenkins the definitive guide

(Jeff_L) #1

changes were made that only affected it, and not the core module. A better approach is to use the “Block
build when upstream project” option. In this case, when the version numbers are updated in version
control, Jenkins will schedule both builds to be executed. However it will wait until the core build has
finished before starting the web application build.


game-of-life-core
version 1.0.0-SNAPSHOT

revision 100 revision 101

game-of-life-core
version 1.0.0

game-of-life-web
version 1.0.0-SNAPSHOT

game-of-life-web
version 1.0.0

Subversion revisions

Figure 5.5. The “Block build when upstream project is building” option is useful when a single commit
can affect several related projects


You can also override the default workspace used by Jenkins to check out the source code and build
your project. Normally, Jenkins will create a special workspace directory for your project, which can be
found in the project’s build job directory (see Section 3.13, “What’s in the Jenkins Home Directory”).
This works fine in almost all cases. However, there are times when you need to override this option,
and force Jenkins to use a special directory. One common example of this is if you want several build
jobs to all work successively in the same directory. You can override the default directory by ticking
the “Use custom workspace” option, and providing the path yourself. The path can be either absolute,
or relative to Jenkins’s home directory.


We will look at some of the other more advanced options that appear in this section later on in the book.


5.4. Configuring Source Code Management


In its most basic role, a Continuous Integration server monitors your version control system, and checks
out the latest changes as they occur. The server then compiles and tests the most recent version of the
code. Alternatively, it may simply check out and build the latest version of your source code on a regular
basis. In either case, tight integration with your version control system is essential.


Because of its fundamental role, SCM configuration options in Jenkins are identical across all sorts
of build jobs. Jenkins supports CVS and Subversion out of the box, with built-in support for Git, and
also integrates with a large number of other version control systems via plugins. At the time of writing,
SCM plugin support includes Accurev, Bazaar, BitKeeper, ClearCase, CMVC, Dimensions, Git, CA
Harvest, Mercurial, Perforce, PVCS, StarTeam, CM/Synergy, Microsoft Team Foundation Server, and
even Visual SourceSafe. In the rest of this section, we will look at how to configure some of the more
common SCM tools.

Free download pdf