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

Job DSL Support without Dynamic DSL

    XMLWordPrintable

Details

    Description

      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.

      Attachments

        Activity

          oleg_nenashev 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 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.
          daspilker Daniel Spilker added a comment - It is already supported, see https://jenkinsci.github.io/job-dsl-plugin/#path/job-wrappers-buildName
          ciis0 Christoph Schulz added a comment - - edited

          I am talking about the buildNameUpdater step here.

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

          Screenshot from the API viewer from our Jenkins.

          ciis0 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)
                  }
              }
          }
          
          daspilker 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 ) } } }

          People

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

            Dates

              Created:
              Updated:
              Resolved: