alcedine
alcedine

Reputation: 949

How do I make a job mutually exclusive with a set of jobs in Jenkins?

I have in Jenkins a set of jobs A1, A2, ... that can be executed concurrently, as well as a job B that must never be executed concurrently with any job Ai. All these jobs run on the same node (the jobs Ai use a pool of executors that, for reasons that can't be helped, occasionally have to be shepherded by job B). Can I enforce this in Jenkins?

The concept is similar to that of a shared mutex; the jobs Ai require shared-level access to the pool, while the job B requires exclusive-level access.

I'm looking at the Throttle Concurrent Builds plugin, but it appears from the options that it provides that it only has one level of access. I could make B never be concurrent with any Ai, but only by making all Ai mutually exclusive as well.

Is there a way to achieve shared-mutex-like behavior, either with this plugin or otherwise?

Upvotes: 2

Views: 846

Answers (1)

Gerold Broser
Gerold Broser

Reputation: 14762

  • There's the Block queued job plugin:

    Plugin for blocking/unblocking job in queue by some conditions configured in this job.

  • There's the Build Blocker Plugin:

    This plugin keeps the actual job in the queue if at least one name of currently running jobs is matching with one of the given regular expressions.

Upvotes: 2

Related Questions