What am I doing wrong?
Sequential launch works, Parallel launch breaks with the error:
....
java.lang.IllegalArgumentException: Expected named arguments but got org.jenkinsci.plugins.workflow.cps.CpsClosure2@21710cb6
def map = [
Gosha : 45,
Gera : 15,
Serega : 33
]
def stages_to_run = {
map.each { key, value ->
stage("phase_${key}") {
echo "name: 'Name', value: ${key}"
echo "name: 'Age', value: ${value}"
}
}
}
pipeline {
agent any
stages {
stage('loop') {
steps {
script {
// stages_to_run() it works
parallel stages_to_run() // it does not work
}
}
}
}
}
I guess I lack understanding of groovy
New contributor