Jenkins 詹金斯:disableConcurentBuild不工作
我有一个多分支管道,我想确保它一次执行一次运行。我无法在代理上设置单个执行器,因为其他作业可以在其他工作区中运行 以下是我的管道的脚本编写方式:Jenkins 詹金斯:disableConcurentBuild不工作,jenkins,concurrency,multibranch-pipeline,Jenkins,Concurrency,Multibranch Pipeline,我有一个多分支管道,我想确保它一次执行一次运行。我无法在代理上设置单个执行器,因为其他作业可以在其他工作区中运行 以下是我的管道的脚本编写方式: /* Job properties */ properties([ disableConcurrentBuilds(), gitLabConnection('Gitlab'), [$class: 'RebuildSettings', autoRebuild: false, rebuildDisabled: true],
/* Job properties */
properties([
disableConcurrentBuilds(),
gitLabConnection('Gitlab'),
[$class: 'RebuildSettings', autoRebuild: false, rebuildDisabled: true],
[$class: 'JobRestrictionProperty'],
[$class: 'ThrottleJobProperty', categories: [], limitOneJobWithMatchingParams: false, maxConcurrentPerNode: 1, maxConcurrentTotal: 1, paramsToUseForLimit: '', throttleEnabled: true, throttleOption: 'project'],
[$class: 'JobInclusionJobProperty', jobGroupName: 'UrgentJobs', useJobGroup: false]
])
node( allowedNodes ) {
def hadBuildSucceeded = false
ws(custom_directory) {
.....
}
}
当我一次推送三个分支时,作业将同时开始运行三次,有没有关于为什么会失败的建议?如果需要推送多个不同的分支,它仍将构建所有分支,此选项(disableConcurrentBuilds)只需将每个分支一次限制为一个构建,并将在创建初始作业后为任何推送的提交将作业排队
这似乎是一个bug(尚未解决,@2018年4月):很遗憾,在线文档没有明确限制。解决方法是使用专用插件锁定资源: