jenkins the definitive guide

(Jeff_L) #1

Below is an example of invoking jobs with the Parameterized Trigger plugin. Using this option assumes
you have this plugin installed already:


<job>
<id>google-guice-inheritance-trunk</id>
...
<invoke>
<jobs>
google-guice-inheritance-3.0-rc3,
google-guice-inheritance-2.0-maven
</jobs>
</invoke>
</job>

<job>
<id>google-guice-inheritance-3.0-rc3</id>
...
</job>

<job>
<id>google-guice-inheritance-2.0-maven</id>
...
</job>

The element lets you invoke other jobs each time the current job finishes successfully. You
can create a pipeline of jobs this way, making sure each job in a pipeline invokes the following one. Note
that if there are more than one Jenkins executors available at the moment of invocation, the specified
jobs will start running in parallel. For serial execution you’ll need to connect each upstream job to a
downstream one with .


By default invocation happens only when the current job is stable. This can be modified, as shown in
the following examples:


<invoke>
<jobs>jobA, jobB, jobC</jobs>
<always>true</always>
</invoke>

<invoke>
<jobs>jobA, jobB, jobC</jobs>
<unstable>true</unstable>
</invoke>

<invoke>
<jobs>jobA, jobB, jobC</jobs>
<stable>false</stable>
<unstable>false</unstable>
<failed>true</failed>
</invoke>

The first invocation in the example above always invokes the downstream jobs. It can be used for a
pipeline of jobs that should always be executed even if some of them or their tests fail.

Free download pdf