Jenkins any version.
I have two versions: 1.642.3 or 2.32.3
I have a Jenkins job jobA. Let's assume this job deploys an artifact to a target deploy server.
- It takes 2 parameters, artifact name and target deploy server.
- Execute concurrent build is currently DISABLED i.e. not check marked.
Assuming I launched multiple builds on this job manually -or via Jenkins CLI -or via Rest API way (i.e. via some automation/integration/parent upstream job calling this job).
- I now see, there is one Jenkins build in-progress -and- all other N no. of runs are in "queued" mode.
Let's assume I have close to 100+ such builds in the queue (ready to be launched as soon as the in-progress one completes), I'm trying to see if there's a way I can PAUSE the existing queued builds (PS: I do NOT want to cancel them) and launch a new build (which I want to deploy urgently) and once that's done, UNPAUSE the queued builds (so that I don't have to cancel all of them and re-submitting/re-building them again by remembering what were the parameters passed -- for artifact name and target deploy server).
My 3 Conditions:
1) One of my current situation is the server where this job is running is one Jenkins master/slave machine (which have some credentials that can't be taken to other machines i.e. I can't replicate the source Jenkins machine (where the job is running as a slave(s) and thus, I can't use bunch of slaves) and
2) This job also creates some runtime folders/files at a common location on the source machine which I don't want to get overwritten by running concurrent / parallel builds if I enable "Execute concurrent builds". I know, the workspace for concurrent builds is individual to each job run, but not if the job is creating a common folder/file during it's run.
3) I don't want to create a copy of this job :)
In one sentence, is it possible to PAUSE existing queued builds (or some of the queued builds) so that I can launch a new build or make other ones take priority as the next build and then UNPAUSE the paused ones to resume (as launched without requiring them to relaunch)?