Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-55438

Allow sequential stages inside parallel in Scripted syntax

    Details

    • Similar Issues:

      Description

      Similar to JENKINS-46809, I would like the Blue Ocean GUI to properly visualize multiple stages in sequence that are all parallel of each other. Below is an example image of what this looks like using declarative syntax (working):

       

      Here is the declarative example code I wrote to generate the example image:

      pipeline {
        agent { label 'master' }
        stages {
          stage('Build and Test') {
            parallel {
              stage("Build and Test Linux") {
                stages {
                  stage("Build (Linux)") {
                    agent any
                    steps {
                      echo "Inside for loop 1"
                    }
                  }
                  stage("Test (Linux)") {
                    agent any
                    steps {
                      echo "Inside for loop 2"
                    }
                  }
                }
              }
              stage("Build and Test Windows") {
                stages {
                  stage("Build (Windows)") {
                    agent any
                    steps {
                      echo "Inside for loop 3"
                    }
                  }
                  stage("Test (Windows)") {
                    agent any
                    steps {
                      echo "Inside for loop 4"
                    }
                  }
                }
              }
            }
          }
        }
      }

       

      Here is example scripted Jenkins code that I would like to use. Linux and windows build/test flows happen in parallel. Inside each flow in a "build" stage and then a "test" stage. The Windows sequential build/test flow should be displayed in parallel with the Linux build/test flow, but right now the separate Build/Test sequential stages are combined into one circle/stage when using the scripted syntax.

       

      pipeline {
        agent any
        stages {
          stage("Build and Test") {
            steps {
              script {
                parallel linux: {
                  node("linux_build") {
                    echo "Inside for loop 1"
                  }
                  node("linux_test") {
                    echo "Inside for loop 2"
                  }
                },
                windows: {
                  node("windows_build") {
                    echo "Inside for loop 3"
                  }
                  node("windows_test") {
                    echo "Inside for loop 4"
                  }
                }
              }
            }
          }
        }
      }
      

       

      This is what the scripted example code currently generates:

       

        Attachments

          Issue Links

            Activity

            acarr468 Adam Carroll created issue -
            abayer Andrew Bayer made changes -
            Field Original Value New Value
            Component/s blueocean-plugin [ 21481 ]
            Component/s pipeline [ 21692 ]
            Component/s pipeline-model-definition-plugin [ 21706 ]
            abayer Andrew Bayer made changes -
            Assignee Andrew Bayer [ abayer ]
            peacemoon An Tran made changes -
            jglick Jesse Glick made changes -
            Issue Type Improvement [ 4 ] Bug [ 1 ]
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-53048 [ JENKINS-53048 ]
            mahima Mahima Mishra made changes -
            Attachment Screenshot from 2019-11-01 13-05-19.png [ 49371 ]
            mahima Mahima Mishra made changes -
            Attachment Screenshot from 2019-11-01 13-05-19.png [ 49371 ]
            mahima Mahima Mishra made changes -
            zionyx KY Lee made changes -
            Link This issue relates to JENKINS-53751 [ JENKINS-53751 ]
            zionyx KY Lee made changes -
            Link This issue relates to JENKINS-53751 [ JENKINS-53751 ]
            zionyx KY Lee made changes -
            Link This issue is related to JENKINS-53751 [ JENKINS-53751 ]
            zionyx KY Lee made changes -
            Link This issue relates to JENKINS-53162 [ JENKINS-53162 ]
            betoz Alberto Arango made changes -
            betoz Alberto Arango made changes -
            Attachment mixed-declarative-and-scripted.PNG [ 52217 ]

              People

              • Assignee:
                Unassigned
                Reporter:
                acarr468 Adam Carroll
              • Votes:
                26 Vote for this issue
                Watchers:
                32 Start watching this issue

                Dates

                • Created:
                  Updated: