I'm trying to generate and launch build stages in parallel for a list of projects in a loop:
steps {
...
PROJECT_LIST = []
PROJECT_LIST += "project1"
PROJECT_LIST += "project2"
PROJECT_LIST += "project3"
for (def element = 0; element < PROJECT_LIST.size(); element++) {
//parallel {
stage("Parallel build run on ${PROJECT_LIST[element]}") {
build_project "${PROJECT_LIST[element]}"
}
}
//}
...
}
I can run it's stages without any problems, but when I uncomment
parallel {}
statement I get java.lang.IllegalArgumentException: Expected named arguments but got org.jenkinsci.plugins.workflow.cps.CpsClosure2@3de759b7 error.