下游Jenkins项目获得错误的上游运行参数 [英] Downstream Jenkins project gets wrong upstream run parameter

查看:1997
本文介绍了下游Jenkins项目获得错误的上游运行参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Jenkins构建管道的问题。第一个作业之后的所有作业都使用第一个作业的运行参数进行参数化。默认情况下,这应该引用第一个作业的最近的稳定版本。每个后续作业使用第一个作业的运行参数访问第一个作业中保存的工件。每个后续作业触发管道的下一个作业作为参数化构建,并通过上述运行参数。管道的第一个作业触发第二个作业为一个简单的(即不是参数化的)构建。

I'm having a problem with a Jenkins build pipeline. All jobs after the first one are parameterized with the "Run Parameter" of the first job. By default, this should reference the most recent stable build of the first job. Each subsequent job uses the "Run Parameter" of the first job to access saved artifacts from the first job. Each subsequent job triggers the next job of the pipeline as a parameterized build and passes the aforementioned "Run Parameter". The first job of the pipeline triggers the second job as a simple (i.e., not parameterized) build.

这是下游作业的相关配置的屏幕截图:

Here's a screenshot of the relevant configuration of a downstream job:

我的问题是在运行参数中的作业号不是管道的第一个作业的作业号。相反,它是上一个管道的第一个作业的作业编号。因此,如果第一个作业在编译#11,则该管道的所有后续作业将访问第一个作业的编译#10的存档。

My problem is that the job number in the "Run Parameter" isn't the job number of the first job of the pipeline. Instead, it's the job number of the first job of the previous pipeline. Thus, if the first job is on build #11, then all subsequent job of that pipeline will access the archive of build #10 of the first job.

我如何获取管道的后续作业以访问管道的第一个作业的归档目录。

How can I get the subsequent jobs of the pipeline to access the archive directory of the first job of the pipeline?

推荐答案

我发现了答案。显然,下游作业正在使用来自之前管道的上游作业的工件的原因是因为我已将下游作业的配置中的运行参数过滤器设置为仅稳定构建 。将此过滤器设置为所有构建可以产生正确的行为。

I discovered the answer. Apparently, the reason the downstream job was using the artifacts from the upstream job of the previous pipeline was because I had set the "Run Parameter" filter in the configuration of the downstream job to "Stable Builds Only". Setting this filter to "All Builds" results in correct behavior.

就像Jenkins不考虑上游作业在它的帖子中开始另一个构建-build section。

It's as if Jenkins doesn't consider an upstream job to be stable when it's starting another build in its post-build section.

这篇关于下游Jenkins项目获得错误的上游运行参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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