Is it possible to save some values during a parallel execution and use these values during a final step?
In the following example, I would like to know which jenkins slave is used during the parallel execution and use it during the final step.
node {
stage 'Checkout'
checkout([...])
stash includes: '**', name: 'binary'
stage 'Running simulation'
parallel (
"stream 1" : {
node {
unstash "binary"
sh "echo \"\$(whoami)@\$(hostname):\$PWD\""
// How to save the previous result
// Run simulation on node first slave
...
}
},
"stream 2" : {
node {
unstash "binary"
sh "echo \"\$(whoami)@\$(hostname):\$PWD\""
// How to save the previous result
// Run simulation on node second slave
...
}
}
)
stage 'Gathering results files'
// use the values of the slaves to retrieve some files.
stage 'Generate report'
}
Thanks for your answer.