How to pass output from an upstream project to downstream projects in Jenkins

前提是你 提交于 2019-12-13 05:39:46

问题


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. Determine which servers are available/operational.
  2. Select subsets of the available servers for each test.
  3. Pass sets of IP addresses down to multiple projects to be run in parallel.

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.


回答1:


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.



来源:https://stackoverflow.com/questions/27572905/how-to-pass-output-from-an-upstream-project-to-downstream-projects-in-jenkins

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!