如何防止相同类型的两个管道 jenkins 作业在同一节点上并行运行? [英] How do I prevent two pipeline jenkins jobs of the same type to run in parallel on the same node?
本文介绍了如何防止相同类型的两个管道 jenkins 作业在同一节点上并行运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我不想让相同类型(相同存储库)的两个作业在同一个节点上并行运行.
I do not want to allow two jobs of the same type (same repository) to run in parallel on the same node.
如何在 Jenkinsfile 中使用 groovy 来做到这一点?
How can I do this using groovy inside Jenkinsfile ?
推荐答案
https://stackoverflow.com/a 中提供的答案/43963315/6839445 已弃用.
目前禁用并发构建的方法是设置选项:
The current method to disable concurrent builds is to set options:
options { disableConcurrentBuilds() }
这里有详细的描述:https://jenkins.io/doc/book/pipeline/syntax/#options一个>
这篇关于如何防止相同类型的两个管道 jenkins 作业在同一节点上并行运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文