Jesus Fernandez
Jesus Fernandez

Reputation: 570

how to tell jenkins to check if another job is being executed a job is triggered by webhooks?

I have been looking about this thing. Basically let´s say I have pipeline x and pipeline y, and pipeline x is trigerred whenever a commit is pushed, but I want this pipeline x to check if pipeline y is running and if so wait untill it finishes... is there any way to do this? I though of having global variables for Jenkins as flags but that would just stop from running no wait until the other job has finished

Upvotes: 0

Views: 841

Answers (1)

Khez
Khez

Reputation: 10350

It seems like you want to have a set of mutually exclusive jobs.

You're in luck, since there's a couple of different plugins out there that can do this, one of which is: https://plugins.jenkins.io/build-blocker-plugin/

As long as your jobs use a naming convention that don't accidentally clash when waiting for one another, you should be safe.

Upvotes: 1

Related Questions