Extract this in a shell script or so.
Use Jenkins pipeline for orchestration, not for programming.
It sounds tempting to use pipeline like it's Groovy. But first it's not
*really* Groovy as you've discovered and second it'll make it very hard to
develop locally if the build process steps are only
I use a different approach ... but it may not fits your use case.
In any case, usually when I have to perform operation on each element of a
Map, I end up on transform the Map on steps that I can feed to parallel
steps {
stepsMap = [:]
stepsMap = dataMap.collectEntries{[
"Name of step to
I'm posting this mostly so people can find it. Perhaps it's already
well-known, and perhaps I'm missing some simple thing that makes this
easier to do, but I think not.
In my Jenkinsfile, I need to iterate over a map created with Groovy,
calling "writeFile" with the key as the file name, and t