Useful to give a label to one or more steps that are otherwise opaque in the log.

      stage('Deploying') {
          sh './deploy.sh --some-long-arguments'
      }
      

      FlowGraphTable should hide the body of the label step by default.

      Alternatives considered:

      sh script: './deploy.sh', label: 'Deploying'
      

      which does not scale well as a design (labeling should be orthogonal to step definitions); or implicit label creation when Groovy label expressions are encountered:

      LABEL: sh '/bin/perl abc def'
      

      which may break down:

      FOO:
      def x = 1;
      for (...) {
          ...
      }
      

        1. stage-view.JPG
          34 kB
          mohamed badran
        2. blueocean-failure.JPG
          60 kB
          mohamed badran

          [JENKINS-26107] Allow stage to operate as a labelled block

          Michael Neale added a comment -

          mbadran can you put that in a differnet ticket under the "blueocean-plugin" component? It fails to showing just the log so you see something. nested stages aren't well supported yet, so would need to decide how to lay that out.

          Michael Neale added a comment - mbadran can you put that in a differnet ticket under the "blueocean-plugin" component? It fails to showing just the log so you see something. nested stages aren't well supported yet, so would need to decide how to lay that out.

          michaelneale Ok, I've created new issue about this JENKINS-38442

          mohamed badran added a comment - michaelneale Ok, I've created new issue about this JENKINS-38442

          Kyle Flavin added a comment -

          Is the concurrency parameter no longer available? I'm converting some legacy code to use the new format. We have a lot of stuff that looks like this:

          stage name: 's1: do something', concurrency: 1
          ...
          stage name: 's2: do something else', concurrency: 1
          ...

          Maybe it's not necessary since we're setting the concurrency to "1" anyway?

          Kyle Flavin added a comment - Is the concurrency parameter no longer available? I'm converting some legacy code to use the new format. We have a lot of stuff that looks like this: stage name: 's1: do something', concurrency: 1 ... stage name: 's2: do something else', concurrency: 1 ... Maybe it's not necessary since we're setting the concurrency to "1" anyway?

          Owen Mehegan added a comment -

          kflavin concurrency as a parameter to the stage step is deprecated, in favor of the milestone step. See https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Stage+Step+Plugin and https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Milestone+Step+Plugin

          Owen Mehegan added a comment - kflavin concurrency as a parameter to the stage step is deprecated, in favor of the milestone step. See https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Stage+Step+Plugin and https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Milestone+Step+Plugin

          Alex S. added a comment -

          this ticket is resolved, but for me it's really not clear how i can now label single sh steps?

          Can you give me a code example?

          Alex S. added a comment - this ticket is resolved, but for me it's really not clear how i can now label single sh steps? Can you give me a code example?

          Sam Van Oort added a comment -

          mac110 

          stage('named') {
            sh 'my special shell step'
          }

          Sam Van Oort added a comment - mac110   stage( 'named' ) { sh 'my special shell step' }

          Greg Knapp added a comment -

          So we should use a `stage` block for each command we want to label? Seems like that would lead to a verbose Jenkinsfile

          Greg Knapp added a comment - So we should use a `stage` block for each command we want to label? Seems like that would lead to a verbose Jenkinsfile

          Yes, possibly. But you generally wouldn't "label a command", probably more a couple of them to produce not just a serie of staged named after the called commands, but that stage is actually doing ("checking code coverage" or whatever).

          Baptiste Mathus added a comment - Yes, possibly. But you generally wouldn't "label a command", probably more a couple of them to produce not just a serie of staged named after the called commands, but that stage is actually doing ("checking code coverage" or whatever).

          Greg Knapp added a comment -

          What about being able to label a script block, so you can group several commands and display it as a single operation?

          Greg Knapp added a comment - What about being able to label a script block, so you can group several commands and display it as a single operation?

          batmat I actually used other CI solutions where it naming an "sh" operation was very useful. 

          Marcello de Sales added a comment - batmat I actually used other CI solutions where it naming an "sh" operation was very useful. 

            jglick Jesse Glick
            jglick Jesse Glick
            Votes:
            44 Vote for this issue
            Watchers:
            80 Start watching this issue

              Created:
              Updated:
              Resolved: