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

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

问题描述

我的问题很简单:在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):

  • 正在构建上游项目时阻止构建
  • 在下游项目构建时阻止构建
  • Block build when upstream project is building
  • Block build when downstream project is building

对于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 Pipeline作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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