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

查看:19
本文介绍了下游 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:

我的问题是运行参数"中的作业号不是管道第一个作业的作业号.相反,它是 previous 管道的第一个作业的作业编号.因此,如果第一个作业在 build #11 上,那么该管道的所有后续作业都将访问第一个作业的 build #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?

推荐答案

我找到了答案.显然,下游作业使用 previous 管道上游作业的工件的原因是因为我在下游作业的配置中将运行参数"过滤器设置为仅稳定构建".将此过滤器设置为所有构建"会导致正确的行为.

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 在其后期构建部分开始另一个构建时,就好像 Jenkins 不认为上游作业是稳定的.

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天全站免登陆