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

Allow dynamic stage names

    XMLWordPrintable

    Details

    • Similar Issues:

      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

          Hide
          merlachandra Chandra Babu added a comment -

          Stefan Drissen Could you please explain how you achieved "With stage names based on matrix values:" as in your second screenshot?

          Show
          merlachandra Chandra Babu added a comment - Stefan Drissen  Could you please explain how you achieved "With stage names based on matrix values:" as in your second screenshot?
          Hide
          smd Stefan Drissen added a comment -

          Chandra Babu It's just a mockup with labels modified using developer console to show what it could look like.

          Show
          smd Stefan Drissen added a comment - Chandra Babu  It's just a mockup with labels modified using developer console to show what it could look like.
          Hide
          rajivece Rajiv Rajaian added a comment -

          +1 Vote

          Show
          rajivece Rajiv Rajaian added a comment - +1 Vote
          Hide
          tophergopher Topher Sterling added a comment -

          Liam Newman

          I'm interesting in poking around the UI code - would you still be able to point me in the right direction in the codebase?

          Show
          tophergopher Topher Sterling added a comment - Liam Newman I'm interesting in poking around the UI code - would you still be able to point me in the right direction in the codebase?
          Hide
          jielpe_fr38 Jean-Luc Pé added a comment -

          Some sort of dynamic stage name would really be appreciate. At least, either build parameter or even environment variable declared in environment{} block should be avaible in all pipeline stage names (not only matrix).
          So ... +1

          Show
          jielpe_fr38 Jean-Luc Pé added a comment - Some sort of dynamic stage name would really be appreciate. At least, either build parameter or even environment variable declared in environment{} block should be avaible in all pipeline stage names (not only matrix). So ... +1

            People

            Assignee:
            bitwiseman Liam Newman
            Reporter:
            rittneje Jesse Rittner
            Votes:
            33 Vote for this issue
            Watchers:
            30 Start watching this issue

              Dates

              Created:
              Updated: