Created
January 29, 2019 19:40
-
-
Save hayderimran7/300ae0146ffc13a002af43e45c50493e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Job DSL to create a github organization folder with submodules etc configured | |
organizationFolder('myorg') { | |
description("org") | |
configure { | |
it / navigators / "org.jenkinsci.plugins.github__branch__source.GitHubSCMNavigator" << { | |
repoOwner("someowner") | |
credentialsId("github-user") | |
} | |
} | |
configure { | |
it / projectFactories / "org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProjectFactory" << { | |
scriptPath("Jenkinsfile.build") | |
} | |
} | |
configure { | |
def traits = it / navigators / 'org.jenkinsci.plugins.github__branch__source.GitHubSCMNavigator' / traits | |
traits << "org.jenkinsci.plugins.github__branch__source.SSHCheckoutTrait" { | |
credentialsId("ci") | |
} | |
traits << 'org.jenkinsci.plugins.github_branch_source.BranchDiscoveryTrait' { | |
strategyId 3 | |
} | |
traits << 'jenkins.scm.impl.trait.WildcardSCMSourceFilterTrait' { | |
includes 'repo1* repo2*' | |
} | |
traits << 'jenkins.plugins.git.traits.LocalBranchTrait' { | |
extension { | |
localBranch '**' | |
} | |
} | |
traits << 'jenkins.plugins.git.traits.SubmoduleOptionTrait' { | |
extension(class: 'hudson.plugins.git.extensions.impl.SubmoduleOption') { | |
recursiveSubmodules "true" | |
parentCredentials "true" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment