如何将输出从上游项目传递到Jenkins的下游项目 [英] How to pass output from an upstream project to downstream projects in Jenkins

查看:528
本文介绍了如何将输出从上游项目传递到Jenkins的下游项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用项目的结果生成参数,这些参数可以使用

I want to use a project's results to generate parameters that can be passed down to multiple child projects using s something like the Parameterized Trigger Plugin.

具体来说,我想为测试服务器创建一个父项目,作为资源管理器的一种.构建项目后,将有许多复杂的测试套件要运行,只有那么多的测试服务器.我希望资源管理器项目不是要硬编码我要运行每个测试的测试服务器,而是:

Specifically, I want to make a parent project as a sort of resource manager for my testing servers. Once the project is build, there are a number of complex test suites to run and only so many test servers. Rather than hard-code which test servers I want to run each test, I want the resource manager project to:

  1. 确定哪些服务器可用/可运行.
  2. 为每个测试选择可用服务器的子集.
  3. 将IP地址集向下传递到多个项目以并行运行.

我知道我可以通过使资源管理器将这些参数写入文件系统并配置子项目以从这些文件中读取来做到这一点,但是我敢肯定,这是插件已经解决的问题.我只是看不到触发器插件如何能够从其自身的构建输出中检索任意参数.

I know I could probably do this by having the resource manager write these parameters onto the filesystem and configure the child projects to read from those files, but I'm sure that this is the type of problem already solved by a plugin. I just don't see how to the trigger plugin can retrieve arbitrary parameters from its own build output.

推荐答案

虽然有一个插件,但其工作原理相同:它从文件系统中读取属性文件,并将其作为环境变量加载到该文件的任何步骤中项目. EnvInject插件

There is a plugin, but it works along the same principle: it reads a properties file from filesystem, and loads those as Environment Variables available to any step of the project. EnvInject plugin

它确实具有从脚本而非属性文件生成属性列表的功能.

It does have ability to generate a list of properties from a script, rather than a properties file.

这篇关于如何将输出从上游项目传递到Jenkins的下游项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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