I have a multibranch pipeline and I want to make sure it executes one run at a time. I cannot set a single executor on the agent since other jobs could run in other workspaces.
Here is how my pipeline is scripted:
/* 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) {
.....
}
}
When I push three branches at a time, the job will start running three times at the same time, any suggestion on why this is failling ?