I have a pipeline script that looks like this:
node {
try {
stage('Prepare') {
// git clone here
}
stage('Compile') {
sh "make ${build_type}"
}
stage('Test') {
sh "./run tests ${build_type}"
}
}
finally {
if (fileExists("test_results.xml")) {
junit "test_results.xml"
}
emailext subject: "Build finished",
body: '${JELLY_SCRIPT, template="some-template.template"}',
to: "some-one@somewhere"
}
}
${build_type} can be "release" or "debug".
When my build receives a trigger, I want my pipeline to run once for every parameter in ${build_type} and then send me one email containing a report about both builds.
How can I achieve this?
I tried to define a parallel block inside the Compile stage and set build_type there, but this doesn't make the other stages to run in parallel.