首页 > 解决方案 > Jenkins pipeline start depending on other pipeline status

问题描述

I have the following setup:

Now i want to add a dependency between those two pipelines. Pipeline B should only start if pipeline A ends with the status successfull. How can I achieve this?

标签: jenkinsjenkins-pluginsjenkins-pipeline

解决方案


我知道有两种方法:

  • 您可以在执行管道 B 的管道 A 的末尾添加一个阶段(请参阅构建步骤)。如果您想在 Jenkinsfile 中保留所有构建逻辑,包括项目间依赖项,请使用此方法。
  • 在管道项目配置中设置 Jenkins 内部的构建触发器。请参阅管道项目配置中的“构建其他项目后构建”复选框。如果您想将依赖逻辑保留在 Jenkinsfile 之外,请使用此选项。

推荐阅读