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

support for parallel Stages nested in stages for ressource locking

    Details

    • Similar Issues:

      Description

      I don't want nest parallel in parallel.
      My use case is locking a resource for the parallel and sequential stages as a whole:

      pipeline {
          agent any
          stages {
              stage('Lock wrapper') {
                  options {
                    lock('resource')
                  }     
                  stages {
                      stage('Sequential 1') {
                          steps {
                              echo "Sequential 1"
                          }
                      }
                      stage('Sequential 2') {
                          parallel {
                              stage('Parallel 2a') {
                                  steps {
                                      echo "Parallel 2a"
                                  }
                              }
                          }
                      }
                  }
              }
          }
      }
      

      But this gives following error:
      Parallel stages or branches can only be included in a top-level stage.

      My final pipeline has far more than these stages, so lock of the whole pipeline is not an option.

        Attachments

          Issue Links

            Activity

            There are no comments yet on this issue.

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                tkleiber Torsten Kleiber
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: