我正在尝试在詹金斯管道中创建并行阶段,例如这个例子
node {
stage('CI') {
script {
doDynamicParallelSteps()
}
}
}
def doDynamicParallelSteps(){
tests = [:]
for (f in ["Branch_1", "Branch_2", "Branch_3"]) {
tests["${f}"] = {
node {
stage("${f}") {
echo "${f}"
}
}
}
}
parallel tests
}
我期待看到“Branch_1”、“Branch_2”、“Branch_3”,而不是“Branch_3”、“Branch_3”、“Branch_3”
我不明白为什么。你能帮忙吗?


