我想下面的代碼爲我的參數化管道作業。我想開始從參數中獲取並行運行的作業名稱。 而那些工作也參數化的工作。如何啓動參數化管道作業來觸發並行構建。我也嘗試使用列表,但它沒有工作。任何人都可以建議我我要去哪裏錯了參數化管道作業開始並行構建
def stepsForParallel = [:]
node {
JOBS=JOB_NAMES.split(',');
for (job in JOBS) {
def stepName = "running_${job}"
stepsForParallel[stepName] = { -> build job: "runnning_$job", parameters: [string(name: 'BRANCH',value: $BRANCH),string(name: 'CHANGE_NUMBER',value: $CHANGE_NUMBER)] }
}
parallel stepsForParallel
}
我喜歡輸出:
[Pipeline] parallel
[Pipeline] [running_a] { (Branch: running_a)
[Pipeline] [running_b] { (Branch: running_b)
[Pipeline] [running_a] }
[running_a] Failed in branch running_a
[Pipeline] [running_b }
[running_b] Failed in branch running_b
[Pipeline] }
[Pipeline] End of Pipeline
an exception which occurred:
in field itr
in field target
in field continue_
in field parent
in field parent
in field parent
in field parent
in field parent
in field parent
in field capture
in field def
in field locals
in field capture
in field def
in field closures
in object [email protected]
Caused: java.io.NotSerializableException: java.util.AbstractList$Itr
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:860)
at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
如何啓動參數流水線作業來觸發並行編譯。我也嘗試使用列表,但它沒有工作。任何人都可以建議我在哪裏我錯了
試着去除'for循環'周圍的'node {}'。 –