queue - Jenkins - How to pause queued job's runs and let a new build take priority -


jenkins version.

i have 2 versions: 1.642.3 or 2.32.3

i have jenkins job joba. let's assume job deploys artifact target deploy server.

  • it takes 2 parameters, artifact name , target deploy server.
  • execute concurrent build disabled i.e. not check marked.

assuming launched multiple builds on job manually -or via jenkins cli -or via rest api way (i.e. via automation/integration/parent upstream job calling job).

  • i see, there 1 jenkins build in-progress -and- other n no. of runs in "queued" mode.

let's assume have close 100+ such builds in queue (ready launched in-progress 1 completes), i'm trying see if there's way can pause existing queued builds (ps: not want cancel them) and launch new build (which want deploy urgently) , once that's done, unpause queued builds (so i don't have cancel of them and re-submitting/re-building them again remembering parameters passed -- artifact name , target deploy server).

my 3 conditions:

1) 1 of current situation server job running 1 jenkins master/slave machine (which have credentials can't taken other machines i.e. can't replicate source jenkins machine (where job running slave(s) , thus, can't use bunch of slaves) and

2) job creates runtime folders/files @ common location on source machine don't want overwritten running concurrent / parallel builds if enable "execute concurrent builds". know, workspace concurrent builds individual each job run, not if job creating common folder/file during it's run.

3) don't want create copy of job :)

in 1 sentence, possible pause existing queued builds (or of queued builds) can launch new build or make other ones take priority next build , unpause paused ones resume (as launched without requiring them relaunch)?

you can use priority sorter plugin this.
add new string parameter job, example build_priority , set default value 2. in job priorities menu select use priority build parameter priority strategy , put parameter there. priority configuration

now can run 100+ jobs default build_priority parameter value (2) , if need launch new build urgently set parameter 1 , first build in queue.


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -