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

后端 未结 10 1980
佛祖请我去吃肉
佛祖请我去吃肉 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 03:08

    Example using options block in the declarative pipeline syntax:

    pipeline {
    
      options { 
        disableConcurrentBuilds() 
      }
    
    ...
    }
    

提交回复
热议问题