The buildNameUpdater step of the build-name-setter plugin currently only works in Job DSL due to Dynamic DSL which does not work, for example with the Job DSL Standalone generator.

      It would be nice if the plugin would be support in Job DSL officially.

      Thank you.

          [JENKINS-53962] Job DSL Support without Dynamic DSL

          Oleg Nenashev added a comment -

          I will be happy to review pull requests. The plugin is up for adoption in general, so any contributions are welcome.

          Oleg Nenashev added a comment - I will be happy to review pull requests. The plugin is up for adoption in general, so any contributions are welcome.

          Daniel Spilker added a comment - It is already supported, see https://jenkinsci.github.io/job-dsl-plugin/#path/job-wrappers-buildName

          Christoph Schulz added a comment - - edited

          I am talking about the buildNameUpdater step here.

          Christoph Schulz added a comment - - edited I am talking about the buildNameUpdater step here.

          Screenshot from the API viewer from our Jenkins.

          Christoph Schulz added a comment - Screenshot from the API viewer from our Jenkins.

          The built-in DSL is in Maintenance Mode. If a feature is available in Dynamic DSL, it will not be added to the built-in DSL. When not running Job DSL in Jenkins, use a Configure Block to add any configuration that is missing in the built-in DSL.

          Dynamic DSL example:

          job('example') {
              steps {
                  buildNameUpdater {
                      fromFile(true)
                      buildName('name.txt')
                      fromMacro(false)
                      macroTemplate('')
                      macroFirst(false)
                  }
              }
          }
          

          Configure block example:

          job('example') {
              configure {
                  it / 'builders' / 'org.jenkinsci.plugins.buildnameupdater.BuildNameUpdater' {
                      fromFile(true)
                      buildName('name.txt')
                      fromMacro(false)
                      macroTemplate('')
                      macroFirst(false)
                  }
              }
          }
          

          Daniel Spilker added a comment - The built-in DSL is in Maintenance Mode . If a feature is available in Dynamic DSL , it will not be added to the built-in DSL. When not running Job DSL in Jenkins, use a Configure Block to add any configuration that is missing in the built-in DSL. Dynamic DSL example: job( 'example' ) { steps { buildNameUpdater { fromFile( true ) buildName( 'name.txt' ) fromMacro( false ) macroTemplate('') macroFirst( false ) } } } Configure block example: job( 'example' ) { configure { it / 'builders' / 'org.jenkinsci.plugins.buildnameupdater.BuildNameUpdater' { fromFile( true ) buildName( 'name.txt' ) fromMacro( false ) macroTemplate('') macroFirst( false ) } } }

            daspilker Daniel Spilker
            ciis0 Christoph Schulz
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: