我想一個詹金斯管道運行時從乳寧鎖定一些其他的工作,
我一直在試圖使用排除-插件或油門併發builds-插件
具有這種結構:詹金斯管道節流其他工作
node(){
stage "test"
allocate('test')
sleep time: 15, unit: 'MINUTES'
sh "echo 'yes'" }
@NonCPS
def allocate(String resource){
throttle = new hudson.plugins.throttleconcurrents.ThrottleJobProperty(
maxConcurrentPerNode=1,
maxConcurrentTotal=1,
categories = [resource],
throttleEnabled=true,
throttleOption="category",
matrixOptions=null
)
throttle.setOwner()
throttle = null
return true
}
但它似乎並不做任何事情...
我開始用Groovy的流水線插件,我通過無力塊油門其他作業
謝謝你的幫助!
看起來像分支合併爲主:) –
請記住,鎖定資源插件阻止作業執行之後,節點/執行器已被分配。 – deadmoto