There is a jenkins pipeline job ("parent"). From it - on one stage there is called another pipeline job ("child" - using build job command).
Is there any way to return something (for example short text) from child to parent job without using external services like artificatory, and don't assuming that parent and child jobs are on the same machine?
One way you can do this is with Jenkins' built-in artifacts. I like to use JSON for this purpose since Pipeline has built-in
readJSON
andwriteJSON
methods.For instance, here's what the configuration from the parent job might look like:
And then your child job would need to write the
mydata.json
file to the artifact store somewhere in its Pipeline job config, e.g.: