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

Allow for nesting Parallel and Matrix blocks

XMLWordPrintable

      Apologies if this is a duplicate, but I couldn't find another ticket.

      I'd like to create a job that runs a standalone stage, and a matrix based stage, in parallel. Below is an example of what I'm thinking. The AWS job has different steps / params, so it would be run in parallel to the matrix build, which has several more variants.

      When running the below, the build stops, and tells me `"matrix" or "parallel" cannot be nested inside another "matrix" or "parallel"`.
       

          stage('Build Images') {
            parallel {
              stage ('Build AWS') {
                steps {
                  echo "Running AWS Clone Packer Job"
                  sh 'doing stuff'
                }
              }
      
              stage('Build vCenter') {
                matrix {
                  axes {
                    axis {
                      name 'DC'
                      values 'DC1', 'DC2'
                    }
                    axis {
                      name 'DB'
                      values 'DB1', 'DB2'
                    }
                    axis {
                      name 'TENNANTS'
                      values 'ST', 'MT'
                    }
                  }
                }
                steps {
                  echo "Running vCenter Clone Packer Job"
                  sh "doing something in a matrix"
                }
              }
            }
          }
      

            Unassigned Unassigned
            herocc CC
            Votes:
            15 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated: