Mat*_*teo 2 parallel-processing jenkins jenkins-pipeline
我正在编写一个新的 Jenkins 管道,并有一组我最终希望并行运行的步骤。但是在我开发这个管道时,我想强制它按顺序运行。我没有看到任何方法来指定并行步骤使用的线程数或类似的东西。这是到目前为止的基本代码:
node('x') {
stage('cleanup'){
def cleanupScripts = [:]
cleanupScripts[1] = { sh(script: "cleanup1.sh") }
cleanupScripts[2] = { sh(script: "cleanup2.sh") }
cleanupScripts[3] = { sh(script: "cleanup3.sh") }
cleanupScripts[4] = { sh(script: "cleanup4.sh") }
parallel cleanupScripts
}
}
Run Code Online (Sandbox Code Playgroud)
我希望能够在不更改大量代码的情况下按顺序运行这些 shell 脚本。
小智 6
而不是parallel cleanupScripts你可以像这样使用:
cleanupScripts.each{ key, value ->
value()
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2249 次 |
| 最近记录: |