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

Unable to set extensions for Git SCM Source via DSL

    Details

    • Similar Issues:

      Description

      In the past I used `gitSCMSource` to specify my git configuration with extensions in my Job DSL.
       
      Template I used:

      multibranchPipelineJob('${JOB_NAME}') {
          displayName('${JOB_NAME}')
          description('${JOB_DESCRIPTION}')
          orphanedItemStrategy {
              discardOldItems {
                  numToKeep(7)
              }
          }
          branchSources {
              branchSource {
                  source {
                      gitSCMSource {
                          id('')
                          remoteName('origin')
                          rawRefSpecs('')
                          ignoreOnPushNotifications(false)
                          remote('${JOB_GIT_URL}')
                          credentialsId('${GIT_CREDENTIALS_ID}')
                          includes('*')
                          excludes('')
                          extensions {
                              wipeWorkspace()
                              preBuildMerge {
                                  options {
                                      mergeRemote('origin')
                                      mergeTarget('${GIT_BRANCH}')
                                      mergeStrategy('default')
                                      fastForwardMode('FF')
                                  }
                              }
                          }
                      }
                  }
              }
          }
      }

      Now after updating to latest Jenkins/Plugins this no longer works. I looked at using the `git` source instead of `gitSCMSource` but it does not provide a way to set the extensions.

      In the new git-plugin 3.4.0 extensions are deprecated and are now traits. Not sure if this has anything to do with the issue.

        Attachments

          Issue Links

            Activity

            arty13 Art V created issue -
            arty13 Art V made changes -
            Field Original Value New Value
            Attachment Screen Shot 2017-07-21 at 09.36.26.png [ 38988 ]
            Attachment Screen Shot 2017-07-21 at 09.36.06.png [ 38989 ]
            stephenking Steffen Gebert made changes -
            Link This issue is related to JENKINS-46202 [ JENKINS-46202 ]
            markewaite Mark Waite made changes -
            Assignee Mark Waite [ markewaite ]
            stephenconnolly Stephen Connolly made changes -
            Link This issue duplicates JENKINS-45504 [ JENKINS-45504 ]
            stephenconnolly Stephen Connolly made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Duplicate [ 3 ]
            daspilker Daniel Spilker made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            sag47 Sam Gleske made changes -
            Labels job-dsl plugin git-plugin job-dsl plugin

              People

              • Assignee:
                Unassigned
                Reporter:
                arty13 Art V
              • Votes:
                1 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: