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

Ability to factor out multiple stages into shared libraries

XMLWordPrintable

      I am aware that similar propositions have been made, but no solution has been found for this scenario, which is very common in our organization.

      Suppose there are stages that are project-specific, i.e., S1, S2, ..., Sn, and stages that are project-independent (can be factored out into shared lib), i.e., I1, I2, ..., Im. A pipeline for a project should contains both the project-specific stages as well as the project-independent stages, the latter possiby multiple times, e.g.,

      S1, S2, ..., Sn, I1, I2, ..., Im, I1', I2', ..., Im'

      It would be great to be able to define such a pipeline like this:

      pipeline {
        stages {
          stage ("S1") { ... }
          stage ("S2") { ... }
          ...
          stage ("Sn") { ... }
          sharedStages()
          sharedStages()
        }
      }
      
      def sharedStages() {
        stage ("I1") { ... }
        stage ("I2") { ... }
        ...
        stage ("In") { ... }
      }

       

            abayer Andrew Bayer
            ginmon_dev_of_the_day Ginmon Dev Of The Day
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: