在构建依赖作业时如何阻止 Jenkins 2.x 管道作业 [英] How can I block a Jenkins 2.x Pipeline job while dependent jobs are building

查看:10
本文介绍了在构建依赖作业时如何阻止 Jenkins 2.x 管道作业的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题很简单:在高级项目选项"下的 Freestyle Jenkins 项目中,我可以选择两个配置选项来帮助防止不同项目之间的冲突(例如,当一个项目更新一组头文件而另一个项目更新时可能会出现这种情况包括这些):

My question is fairly straightforward: With a Freestyle Jenkins project under "Advance Project Options" I can select two configuration options that help prevent conflicts between different projects (that may arise e.g. when one project updates a set of header files while another project is including these):

  • 上游项目正在构建时阻止构建
  • 在构建下游项目时阻止构建

对于 Pipeline 或 Multibranch 项目,这些配置选项不可用,我正在(到目前为止没有成功)寻找一种方法来为 Pipeline 或 Multibranch 项目实现相同的效果.

For a Pipeline or Multibranch project these configuration options are unavailable, and I am (so far without success) looking for a way to achieve the same effect for a Pipeline or Multibranch project.

推荐答案

你可以用 可锁定资源插件.

通过创建上游和下游项目使用的共享资源.让管道等待它可用.

By creating a shared resource used by upstream, and downstream, projects. Let the pipeline wait for it to be available.

这篇关于在构建依赖作业时如何阻止 Jenkins 2.x 管道作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆