I have a very long and complex pipeline that I rewrite after a major jenkins update.
I would like to declare my stages as variables and then execute them in the main node tag: I can do this easily for parallel stages, but I want to have the same style for the sequential one as well.
After many tests, the only way I found this work is to use “fake” parallel calls around all consecutive stages (ugly), I'm sure there is a better solution, but it seems like I can't find the right step ... to dishonor me .
Here is my example:
stage1 = { stage("one") { println "stage one" } } stage2 = { stage("two") { println "stage two" } } stage3 = { stage("three") { println "stage three" } } node { parallel ( "one" : stage1 , "two" : stage2 ) HERE I WANT TO CALL stage3 Closure, possibly giving a map like in the parallel above }
source share