Dynamic Configuration of a matrix build.

134 views
Skip to first unread message

Stu MacDonald

unread,
Sep 12, 2011, 3:58:16 AM9/12/11
to Jenkins Users
I have a Jenkins job consisting of a matrix style configuration. I
want to run a script that determines whether that combination should
be run (similar to the combination filter, but dynamic). Thus setting
the job to 'No Run' (grey) or running the rest of the scripts over it
and producing a result.

Is there a way (or a plugin) to do this? In the event there isn't is
there a way to set a job to 'No Run' once it has started running?

Cheers,
Stu

Dirk Haun

unread,
Sep 12, 2011, 6:16:38 AM9/12/11
to jenkins...@googlegroups.com
On Mon, Sep 12, 2011 at 9:58 AM, Stu MacDonald <stu...@gmail.com> wrote:
> I have a Jenkins job consisting of a matrix style configuration. I
> want to run a script that determines whether that combination should
> be run (similar to the combination filter, but dynamic). Thus setting
> the job to 'No Run' (grey) or running the rest of the scripts over it
> and producing a result.

I'm in a similar situation. What I did is set up two matrix jobs: The
first one runs the decision process for all combinations and writes it
out as JUnit result files. The second matrix job is then only
triggered when the first one didn't go all green.

I.e. green (or blue, if you prefer ;-) for the first job means
"everything's up to date, no need to run the second job".

You would need the Parameterized Trigger plugin to only trigger a
downstream job on certain conditions:
https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Trigger+Plugin

Vojtech Juranek

unread,
Sep 12, 2011, 6:30:10 AM9/12/11
to jenkins...@googlegroups.com
> I have a Jenkins job consisting of a matrix style configuration. I
> want to run a script that determines whether that combination should
> be run (similar to the combination filter, but dynamic). Thus setting
> the job to 'No Run' (grey) or running the rest of the scripts over it
> and producing a result.

There's Matrix reloaded plugin [1], however I'm not sure if this is exactly
what you want. What you described is quite high on my TODO list, but I'm not
able to promis any ETA for such plugin:-(


> Is there a way (or a plugin) to do this? In the event there isn't is
> there a way to set a job to 'No Run' once it has started running?

a work around could be System groovy script - you have access to whole Jenkins
JVM, therefore you can run/stop whatever you want (but this is just a hack not
a proper solution)


[1] https://wiki.jenkins-ci.org/display/JENKINS/Matrix+Reloaded+Plugin

> Cheers,
> Stu

Stu MacDonald

unread,
Sep 26, 2011, 8:19:30 AM9/26/11
to Jenkins Users
Hi,

Thanks for the responses Dirk and Vojtech.

I think the pre-job build will be the way to go. The matrix reloaded
plugin looks good, but not quite what I need (everything builds fine,
so triggering a rebuild of unstable jobs isn't the problem).

I'll try this Parameterized Trigger and see how that goes.

Cheers,
Stu
Reply all
Reply to author
Forward
0 new messages