-
New Feature
-
Resolution: Duplicate
-
Major
The GitHub Organization Folder plugin scans an Organization in GitHub and creates jobs for each repository's branches and PRs.
Because it is automating the creation of so many jobs, it is unreasonable to pre-configure everything needed for checkout scm to work for all cases.
I propose that we add an easy mechanism to configure the scm object in Jenkinsfile; allowing adding extensions like shallow clone, clean before/after checkout, submodules.
In JENKINS-37658 jglick said this required an RFE. Using jobDSL isn't useful because all the behavior of GitHub Org Folders cannot be replicated (at least not without lots of glue).
A workaround is do to something like this:
checkout( [ $class: 'GitSCM', userRemoteConfigs: [[credentialsId: 'github-oauth-userpass', url: 'https://github.com/myorg/myrepository']], branches: [[name: '*/$BRANCH_NAME']], extensions: [ [$class: 'AuthorInChangelog'], [$class: 'CheckoutOption', timeout: 10], [$class: 'CleanBeforeCheckout'], [$class: 'CloneOption', depth: 3, honorRefspec: true, noTags: true, reference: '', shallow: true, timeout: 3] ] ] )
This is non-ideal because the user has to know the name of the proper credentials and because they have to hardcode the github repository URL.
- duplicates
-
JENKINS-37220 Job DSL analogue of multibranch projects & organization folders
- Open
- is related to
-
JENKINS-37658 Github-branch-source plugin should support git plugin extensions
- Closed