【问题标题】:Jenkins pipeline - parallel stages merging only at the last stage詹金斯管道 - 并行阶段仅在最后阶段合并
【发布时间】:2016-12-10 16:53:41
【问题描述】:

在提出这个问题之前,我尝试查看 Jenkins 管道文档,更重要的是查看 issue JENKINS-38442

我想创建一个如下所示的管道:

基本上,我希望并行阶段在不同阶段而不是下一阶段本身合并。这可能吗?

到目前为止我能做的最好的就是这个:

以下是生成上述管道的管道代码:

node {
   def staticTests = [:]
   staticTests["unit tests"] = {stage('unit'){ }}
   staticTests["static analysis"] = {stage('static'){ }}

   def tests = [:]
   tests["functional"] = {stage('functional'){}}
   tests["performance"] = {stage('performance'){}}
   tests["security"] = {stage('security'){}}

   stage('prepare'){}
   stage('tests'){parallel(staticTests)}
   stage('build'){}
   stage('int'){}
   stage('regression'){}
   stage('qa'){}
   stage('tests'){ parallel(tests) }
   stage('prod'){}
}

在上面粘贴的修改后的屏幕截图中,哪些更改将帮助我根据需要创建管道?这在今天使用 Jenkins 流水线是否可行?提前感谢您的帮助!

【问题讨论】:

    标签: jenkins groovy jenkins-pipeline jenkins-blueocean


    【解决方案1】:

    你可以写

    node {
      stage('prepare') {}
      parallel main: {
        stage('unit tests') {}
        stage('build') {}
        stage('int') {}
        stage('regression') {}
        stage('qa') {}
        parallel functional: {}, performance: {}, security: {}
      }, 'static analysis': {}
      stage('prod') {}
    }
    

    它将运行您要求的方式(如果我理解正确的话),但 Blue Ocean 目前无法以适当的详细程度显示它,如 JENKINS-38442 中所述。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-10-08
      • 2017-02-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多