简体   繁体   English

Jenkins 将 json 文件传递​​给触发的下游作业

[英]Jenkins pass json file to triggered downstream job

I have a job that has a json file in its parameters.我有一个作业,其参数中有一个 json 文件。 I have this job trigger another job and it needs to pass the parameters.我有这个工作触发另一个工作,它需要传递参数。 I have 'Current build parameters' enabled, but it does not pass files.我启用了“当前构建参数”,但它不传递文件。 How can I get it to pass the json file to the triggered job.我如何才能将 json 文件传递​​给触发的作业。

I did have this working before, we were on 2016 verion of jenkins and recently upgraded to 2.286.我以前确实有过这个工作,我们在 2016 年版本的 jenkins 上,最近升级到 2.286。

I'm not sure about the breaking change that your Jenkins might have experienced, but as a workaround, you can assign a global environment variable in Configure Jenkins to point a path to your JSON file.我不确定您的 Jenkins 可能经历过的重大更改,但作为一种解决方法,您可以在配置 Jenkins 中分配一个全局环境变量以指向您的 JSON 文件的路径。

That variable will be accessible to all jobs, and they can easily refer to it.所有作业都可以访问该变量,并且他们可以轻松引用它。

For every matching file, invoke one build worked to pass the file.对于每个匹配的文件,调用一个构建工作来传递文件。 Just typed in the name of the file that I have in the parameters只需输入我在参数中的文件名

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

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