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

expose configure{} for steps

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Is it possible to expose configure{} for steps (builders)?
      Configuring from project level is not very convenient because it doesn't allow easily preserve order. Using configure{} for not existing dsl provided builders between existed dsl provided builder will allow having cleaner dsl script.

        Attachments

          Activity

          Hide
          daspilker Daniel Spilker added a comment -

          You can use multiple steps with configure blocks in between to preserve the order.

          job('example') {
            steps {
              shell('echo first')
            }
            configure { project ->
              // ...
            }
            steps {
              shell('echo last')
            }
          }
          
          Show
          daspilker Daniel Spilker added a comment - You can use multiple steps with configure blocks in between to preserve the order. job( 'example' ) { steps { shell( 'echo first' ) } configure { project -> // ... } steps { shell( 'echo last' ) } }
          Hide
          integer Kanstantsin Shautsou added a comment -

          Is it processed successively?

          Show
          integer Kanstantsin Shautsou added a comment - Is it processed successively?
          Hide
          daspilker Daniel Spilker added a comment -

          Yes, each of the top level methods (steps, publishers, configure, ...) is processed successively.

          Show
          daspilker Daniel Spilker added a comment - Yes, each of the top level methods ( steps , publishers , configure , ...) is processed successively.
          Hide
          integer Kanstantsin Shautsou added a comment -

          Then it will work, but code wouldn't look so elegant

          
          job('example') {
            steps {
              shell('echo first')
              configure { steps ->
              // ...
              }
              shell('echo last')
            }
          }
          
          Show
          integer Kanstantsin Shautsou added a comment - Then it will work, but code wouldn't look so elegant job( 'example' ) { steps { shell( 'echo first' ) configure { steps -> // ... } shell( 'echo last' ) } }

            People

            • Assignee:
              daspilker Daniel Spilker
              Reporter:
              integer Kanstantsin Shautsou
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: