Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/jenkins/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jenkins 詹金斯:disableConcurentBuild不工作_Jenkins_Concurrency_Multibranch Pipeline - Fatal编程技术网

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月):

很遗憾,在线文档没有明确限制。解决方法是使用专用插件锁定资源: