How do I prevent two pipeline jenkins jobs of the same type to run in parallel on the same node?

后端 未结 10 1947
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-01 02:18

I do not want to allow two jobs of the same type (same repository) to run in parallel on the same node.

How can I do this using groovy inside Jenkinsfile ?

10条回答
  •  攒了一身酷
    2020-12-01 02:59

    You got at the disableConcurrentBuilds property:

    properties properties: [
      ...
      disableConcurrentBuilds(),
      ...
    ]
    

    Then the job would wait the older one to finish first

提交回复
热议问题