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

Ability to create custom stages in parallel blocks in pipeline shared library

      I would like to be able to easily run the same steps across multiple nodes using the declarative pipeline and a shared library. This does not currently seem to be possible since only custom steps can be created in shared libraries.

       

      Example jenkinsfile:

      pipeline {
          agent any
          stages {
              stage('Build everywhere') {
                  runOnAllPlatforms {
                      sh 'doing build things'
                  }
              }
          }
      }

      Example shared library vars/runOnAllPlatforms.groovy:

      def call(Closure body) {
          parallel {
              stage('RHEL') {
                  agent {
                      node { label 'rhel7' }
                  }
                  steps {
                      body()
                  }
              stage('Apple') {
              agent {
                  node { label 'apple' }
              }
              steps {
                  body()
              }
              steps {
                  body()
              }
          }
      }

          [JENKINS-49662] Ability to create custom stages in parallel blocks in pipeline shared library

          Kevin Lannen created issue -
          Andrew Bayer made changes -
          Component/s New: pipeline-model-definition-plugin [ 21706 ]
          Component/s Original: pipeline [ 21692 ]
          Andrew Bayer made changes -
          Link New: This issue is duplicated by JENKINS-49984 [ JENKINS-49984 ]
          Andrew Bayer made changes -
          Link New: This issue duplicates JENKINS-40986 [ JENKINS-40986 ]
          Andrew Bayer made changes -
          Resolution New: Duplicate [ 3 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          Liam Newman made changes -
          Status Original: Resolved [ 5 ] New: Closed [ 6 ]

            Unassigned Unassigned
            kevlan Kevin Lannen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: