Preventing jobs from running in parallel

40 views
Skip to first unread message

Philip Pemberton

unread,
Feb 19, 2016, 6:39:31 AM2/19/16
to Jenkins Users
Hi,

I've been given the job of automating the build of some new-ish code for a crusty old system which uses a cranky old build system which depends on hard-coded paths. Essentially, all input source files must be in the same directory, my build script has to copy the source into that directory from the Jenkins workspace, then the outputs it produces are zipped and archived.

Sadly I have two independent projects which depend in this little horror of a compiler.

If someone runs a build for Project A, and Project B's scheduled build happens to start just after, one (or both) of the two builds will fail.

I've tried creating a parent project which polls the SCM and kicks off Project A and Project B, then set both "Block build when upstream project is building" and "Block build when downstream project is building" on A and B, but this doesn't have the desired effect (A and B end up stomping on each other).

How can I do this with Jenkins?

Thanks,
Phil.

Philip Pemberton

unread,
Feb 19, 2016, 7:16:31 AM2/19/16
to Jenkins Users
I think I've found a solution in the form of the Lockable Resources plugin:


Thanks.
Phil.

Dirk Heinrichs

unread,
Feb 19, 2016, 7:36:05 AM2/19/16
to jenkins...@googlegroups.com
Am 19.02.2016 um 13:16 schrieb Philip Pemberton:

I think I've found a solution in the form of the Lockable Resources plugin:



What about Build Blocker Plugin?

Bye...

    Dirk
--

Dirk Heinrichs, Senior Systems Engineer, Engineering Solutions
Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach
Tel: +49 2226 1596666 (Ansage) 1149
Email: d...@recommind.com
Skype: dirk.heinrichs.recommind
www.recommind.com

Dirk Heinrichs

unread,
Feb 19, 2016, 7:38:54 AM2/19/16
to jenkins...@googlegroups.com
Am 19.02.2016 um 12:39 schrieb Philip Pemberton:

I've been given the job of automating the build of some new-ish code for a crusty old system which uses a cranky old build system which depends on hard-coded paths. Essentially, all input source files must be in the same directory, my build script has to copy the source into that directory from the Jenkins workspace, then the outputs it produces are zipped and archived.

Sadly I have two independent projects which depend in this little horror of a compiler.

What about running both projects on different slaves?

Fred G

unread,
Feb 22, 2016, 2:55:46 PM2/22/16
to Jenkins Users
Throttle Concurrent Builds Plugin can also be used to prevent jobs from running in parallel:
https://wiki.jenkins-ci.org/display/JENKINS/Throttle+Concurrent+Builds+Plugin
Reply all
Reply to author
Forward
0 new messages