问题
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:
- Determine which servers are available/operational.
- Select subsets of the available servers for each test.
- 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