Answering my own question for internet posterity. I can achieve what I
want by using a 'script' step so my Build step above becomes
stage ('Build') {
steps {
script {
def targets = ["target1", "target2", ...]
def buildSteps = [:]
for (x in targets) {
def targets = x // apparently this is needed, something to
do with closures
buildSteps[target] = {
node ('maker') {
checkout scm
sh "make ${target}_config"
sh "make"
}
parallel buildSteps
}
}
}
}
}
I'd still like to hear if there is a better way to achieve this or if
there was a more declarative way of achieving this
(
https://issues.jenkins-ci.org/browse/JENKINS-40986) sounds promising.