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

job-dsl has deprecated concurrentBuild() on pipeline jobs

    Details

    • Similar Issues:
    • Released As:
      Job DSL 1.71

      Description

      Per https://github.com/jenkinsci/job-dsl-plugin/wiki/Migration#migrating-to-170, and warnings in the console on seed jobs, concurrentBuild() is deprecated for pipeline jobs. Is this is error? concurrent builds can certainly be enabled/disabled on pipeline jobs.

        Attachments

          Issue Links

            Activity

            Hide
            ilatypov Ilguiz Latypov added a comment - - edited

            I would expect that concurrentBuild()s still be allowed by default, but my keeping the "Do not allow" checkbox clear and allowing the multiple node selection in a parameter still generates a single run. The concurrent runs should be allowed/controlled outside our pipeline script even when the latter limits itself to that parameter in a chain "has to run on the node parameter JENKINS_PARAM_RUN_NODE node" -> "fetch the Jenkinsfile script from SCM" -> "execute the script" -> "start the DSL pipeline on a label specified again in DSL via the node parameter JENKINS_PARAM_RUN_NODE".

            ========== SCM Jenkinsfile =====================
            LIBRARY_PIPELINE(
              [
                jenkinsJobInitialAgent: env.JENKINS_PARAM_RUN_NODE ?: 'windows',
                ...
               ]
            )
            
            ========== the library's vars/LIBRARY_PIPELINE.groovy ===========
            def call(Map configuration) {
                pipeline {
                    agent  {
                        label configuration.jenkinsJobInitialAgent
                    }
                    ...
                 }
            }
            
            Show
            ilatypov Ilguiz Latypov added a comment - - edited I would expect that concurrentBuild()s still be allowed by default, but my keeping the "Do not allow" checkbox clear and allowing the multiple node selection in a parameter still generates a single run. The concurrent runs should be allowed/controlled outside our pipeline script even when the latter limits itself to that parameter in a chain "has to run on the node parameter JENKINS_PARAM_RUN_NODE node" -> "fetch the Jenkinsfile script from SCM" -> "execute the script" -> "start the DSL pipeline on a label specified again in DSL via the node parameter JENKINS_PARAM_RUN_NODE". ========== SCM Jenkinsfile ===================== LIBRARY_PIPELINE( [ jenkinsJobInitialAgent: env.JENKINS_PARAM_RUN_NODE ?: 'windows' , ... ] ) ========== the library's vars/LIBRARY_PIPELINE.groovy =========== def call(Map configuration) { pipeline { agent { label configuration.jenkinsJobInitialAgent } ... } }
            Hide
            schniedergers Klaus Schniedergers added a comment -

            Thanks, that seems to work, Grigor Lechev.

            Show
            schniedergers Klaus Schniedergers added a comment - Thanks, that seems to work, Grigor Lechev .
            Hide
            mooncrosser Grigor Lechev added a comment -

            I believe this is the new correct way to do it:

            pipelineJob("name") {
                properties {
                    disableConcurrentBuilds()
                }
                ...
            
            Show
            mooncrosser Grigor Lechev added a comment - I believe this is the new correct way to do it: pipelineJob( "name" ) { properties { disableConcurrentBuilds() } ...
            Hide
            schniedergers Klaus Schniedergers added a comment -

            Workaround:

            pipelineJob('jobname') {
                configure {
                    (it / 'concurrentBuild').setValue('false')
                }
            
            Show
            schniedergers Klaus Schniedergers added a comment - Workaround: pipelineJob( 'jobname' ) { configure { (it / 'concurrentBuild' ).setValue( ' false ' ) }
            Hide
            schniedergers Klaus Schniedergers added a comment -

            When looking into the config.xml, it seems that it's still `<concurrentBuild>false</concurrentBuild>` - so what should the replacement be for the supposedly-deprecated `concurrentBuild(false)` in pipeline jobs?

            Show
            schniedergers Klaus Schniedergers added a comment - When looking into the config.xml, it seems that it's still `<concurrentBuild>false</concurrentBuild>` - so what should the replacement be for the supposedly-deprecated `concurrentBuild(false)` in pipeline jobs?

              People

              • Assignee:
                daspilker Daniel Spilker
                Reporter:
                jhoblitt Joshua Hoblitt
              • Votes:
                6 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: