Not sure if it\'s my limited knowledge of Groovy or a quirk in Pipeline parallel
step. I can\'t make it accept failFast
if I use map instead of passing
It helps a little if you add the optional syntax in. The second option is passing a new Map
while the third option is passing your original Map
and an additional named parameter. Honestly I'm not sure what it thinks is going on.
parallel(map)
parallel([
spam: map['spam'],
eggs: map['eggs'],
failFast: true
])
parallel map, failFast: true
In any case I think the simplest thing would be this:
def map = [
spam: {
node {
echo 'spam'
}
},
eggs: {
node {
echo 'eggs'
}
},
failFast: true
]
parallel map
or...
parallel ([
spam: {
node {
echo 'spam'
}
},
eggs: {
node {
echo 'eggs'
}
},
failFast: true
])
map.failFast = true
parallel map
In addition to Jesse Glick's answer.
Even if you use a for loop to create a parallel stages you can use the same code -
map.failFast = true
parallel map