【发布时间】:2021-04-16 15:05:59
【问题描述】:
stages {
stage('Setup') {
}
stage('Parallel Stage') {
parallel {
stage('Executor 1') {
}
stage('Executor 2') {
}
stage('Executor 3') {
}
stage('Executor 4') {
}
}
}
}
上面是我的 Jenkins 流水线的骨架,它有一个设置阶段,然后是一个并行阶段,该阶段执行相同的操作四次以加快执行时间。
有没有办法将阶段定义为变量以减少 4 倍的代码重复并减少我必须进行的编辑次数?
【问题讨论】:
标签: jenkins jenkins-pipeline jenkins-groovy