简体   繁体   English

如何根据上游作业状态码跳过下游 jenkins 作业

[英]How to skip downstream jenkins job based on upstream job status code

I have a jenkins upstream job Job_A which has a downstream job Job_B .我有一个 jenkins 上游作业Job_A ,它有一个下游作业Job_B Job_A returns a status code(10) if a file is not found in a specific directory.如果在特定目录中未找到文件,则 Job_A 返回状态代码 (10)。 but I don't want Job_A to fail instead I want to skip the downstream job if upstream job exits with status code(10).但我不希望 Job_A 失败,如果上游作业以状态码 (10) 退出,我想跳过下游作业。 Can someone help on how to do this?有人可以帮助如何做到这一点? I'm completely new to Jenkins.我对 Jenkins 完全陌生。

Following is the high-level diagram.以下是高级图。 jenkins-job-condition詹金斯工作条件

I have tried Jenkin's conditional step but I'm unable to find a proper solution.我已经尝试了Jenkins 的条件步骤,但我无法找到合适的解决方案。 在此处输入图像描述

You should define the condition on upstream job by adding Build other projects from Post-build Actions as following.您应该通过从 Post-build Actions 添加Build other projects来定义上游作业的条件,如下所示。

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM