It can be done using "env". If you manage to make j1
add its information into the build's env
.
If j1
was a pipeline you could to env.MYKEY=MYVALUE
.
For a freestyle-job it should work using the EnvInject plugin (didn't try).
In p1
then you will get a map with that information if you out of the build result.
So, if you do in p1
something line this:
// somewhere in your pipeline, i.e. p1:
def j1BuildResult = build job: 'J1'
def j1EnvVariables = j1BuildResult.getBuildVariables();
then j1EnvVariables
will be a map containing the variables you set in j1
.
PS: how to pass that info to as parameters p2
is e.g. covered here.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…