• Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • job-dsl-plugin
    • None

      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.

          [JENKINS-30523] expose configure{} for steps

          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')
            }
          }
          

          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' ) } }

          Is it processed successively?

          Kanstantsin Shautsou added a comment - Is it processed successively?

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

          Daniel Spilker added a comment - Yes, each of the top level methods ( steps , publishers , configure , ...) is processed successively.

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

          job('example') {
            steps {
              shell('echo first')
              configure { steps ->
              // ...
              }
              shell('echo last')
            }
          }
          

          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' ) } }

            jamietanna Jamie Tanna
            integer Kanstantsin Shautsou
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: