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

Allow dynamic stage names

    XMLWordPrintable

Details

    Description

      I would like the ability to have stage names be dynamic strings. This is useful, for instance, when defining stages within a matrix, so that the stage names can contain the values of the axes. (Part of the problem here is that Blue Ocean doesn't render matrixes well at all.) Right now attempting to do this yields an error because stage names can only be string literals, not Groovy strings (interpolation).

      Note that I am not looking for the steps within the stage to be dynamic.

      Example:

      matrix {
          axes {
              axis {
                  name 'PLATFORM'
                  values 'linux', 'mac', 'windows'
              }
          }
          stages {
              stage("Build ${PLATFORM}") {
                  // ...
              }
              stage("Test ${PLATFORM}") {
                  // ...
              }
              stage("Deploy ${PLATFORM}") {
                  // ...
              }
          }
      }
      

      Attachments

        Activity

          rittneje Jesse Rittner created issue -
          bitwiseman Liam Newman made changes -
          Field Original Value New Value
          Assignee Andrew Bayer [ abayer ] Liam Newman [ bitwiseman ]
          smd Stefan Drissen made changes -
          Attachment image-2020-03-19-17-20-23-015.png [ 50709 ]
          smd Stefan Drissen made changes -
          Attachment image-2020-03-19-17-20-50-002.png [ 50710 ]
          smd Stefan Drissen made changes -
          Attachment image-2020-03-19-17-22-05-861.png [ 50711 ]
          smd Stefan Drissen made changes -
          Attachment image-2020-03-19-17-20-50-002.png [ 50710 ]
          smd Stefan Drissen made changes -
          Attachment image-2021-01-27-08-24-59-432.png [ 53889 ]
          gdemengin Guillaume DeMengin made changes -
          Attachment workaround1.png [ 56745 ]
          risingfish Zachary Feuerborn made changes -
          Comment [ Would love to to see this added! ]

          People

            bitwiseman Liam Newman
            rittneje Jesse Rittner
            Votes:
            50 Vote for this issue
            Watchers:
            47 Start watching this issue

            Dates

              Created:
              Updated: