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

Job-dsl support for organizationFolder: DslFactory

XMLWordPrintable

      I will add the buildStrategies in my job-dsl script

      organizationFolder('my-project') {
      ....
          buildStrategies {
          }
      }
      

      Actually it is only supported for branchSource : BranchSourcesContext that i can use with multibranchPipelineJob but not with organizationFolder

      Workaround is make the change manually and look into the generated xml to manuipulate the xml via configure block

      organizationFolder('my-project') {
          ...
          configure {
              // see 
              def buildStrategies = it / buildStrategies
              buildStrategies << 'jenkins.branch.buildstrategies.basic.ChangeRequestBuildStrategyImpl' {
                  ignoreTargetOnlyChanges true
              }
              buildStrategies << 'jenkins.branch.buildstrategies.basic.NamedBranchBuildStrategyImpl' {
                  filters {
                      'jenkins.branch.buildstrategies.basic.NamedBranchBuildStrategyImpl_-ExactNameFilter' {
                          name 1902
                          caseSensitive false
                      }
                      'jenkins.branch.buildstrategies.basic.NamedBranchBuildStrategyImpl_-ExactNameFilter' {
                          name 1907
                          caseSensitive false
                      }
                  }
              }
          }
      }
      

            Unassigned Unassigned
            gimler Gordon Franke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: