jenkins the definitive guide

(Jeff_L) #1
<mail><recipients>[email protected]</recipients></mail>
</job>

<job>
<id>google-guice-inheritance-trunk</id>
<parent>google-guice-inheritance-base</parent>
<repository>
<remote>http://google-guice.googlecode.com/svn/trunk/</remote>
</repository>
</job>

<job>
<id>google-guice-inheritance-3.0-rc3</id>
<parent>google-guice-inheritance-base</parent>
<repository>
<remote>http://google-guice.googlecode.com/svn/tags/3.0-rc3/</remote>
</repository>
</job>

<job>
<id>google-guice-inheritance-2.0-maven</id>
<parent>google-guice-inheritance-base</parent>
<mavenName>apache-maven-2</mavenName>
<repository>
<remote>http://google-guice.googlecode.com/svn/branches/2.0-maven/
</remote>
</repository>
</job>
</jobs>

In this configuration, google-guice-inheritance-base is an abstract parent job holding all common
properties: JDK name, Maven name, days to keep the logs, SVN update policy, Maven goals, and mail
recipients. The three following jobs are very short, merely specifying that they extend a job
and add any missing configurations (repository URLs in this case). When generated, they inherit all of
the properties from the parent job automatically.


Any inherited property can be overridden, as demonstrated in google-guice-inheritance-2.0-maven job
where Maven 2 is used instead of Maven 3. If you want to “cancel” an inherited property, you will need
to override it with an empty value.


Jobs inheritance is a very powerful concept that allows jobs to form hierarchical groups of any kind and
for any purpose. You can group your CI, nightly or release jobs this way, centralizing shared execution
triggers, Maven goals or mail recipients in parent jobs. This approach borrowed from an OOP world
solves the problem of maintaining jobs sharing a number of identical properties.


10.5.3. Plugin Support


In addition to configuring a job and reusing its definitions, you can apply special support for a number
of Jenkins plugins. Right now, a simplified usage of Parameterized Trigger and Artifactory plugins is
provided, with support for other popular plugins planned for future versions.

Free download pdf