-
-
Save identifysun/5393631c6386b0546974b33edf63d710 to your computer and use it in GitHub Desktop.
ci.jenkins.io-jcasc
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
def configuration = [ | |
[ | |
name : "Core", | |
repositories: "jenkins" | |
], | |
[ | |
name : "Infra", | |
repositories: "*", | |
owner : "jenkins-infra" | |
], | |
[ | |
name : "jenkinsfile-runner", | |
displayName: "Jenkinsfile Runner", | |
repositories: "ci.jenkins.io-runner jenkinsfile-runner*", | |
], | |
[ | |
name : "jenkinsci-libraries", | |
displayName: "Libraries", | |
repositories: "dom4j extras-executable-war groovy-sandbox jelly lib-* maven-interceptors plugin-compat-tester trilead-ssh2 xtrigger-lib" | |
], | |
[ | |
name : "Modules", | |
repositories: "*-modules" | |
], | |
[ | |
name : "Packaging", | |
repositories: "docker docker-jnlp-slave docker-slave docker-ssh-slave jnlp-agents" | |
], | |
[ | |
name : "Plugins", | |
repositories: "*-plugin" | |
], | |
[ | |
name : "Reporting", | |
repositories: "backend-plugin-report-card deprecated-usage-in-plugins unused-code-detector", | |
owner: "jenkins-infra" | |
], | |
[ | |
name : "Stapler", | |
owner : "stapler", | |
displayName: "Stapler Web Framework", | |
repositories: "stapler netbeans-stapler-plugin stapler-adjunct-jquery" | |
], | |
[ | |
name : "Tools", | |
repositories: ".github archetypes bom custom-war-packager docker-fixtures gradle-jpi-plugin jenkinfile-runner maven-hpi-plugin plugin-installation-manager-tool plugin-pom" | |
], | |
] | |
configuration.each { jobConfig -> | |
def config = [ | |
displayName: jobConfig.name, | |
owner : "jenkinsci" | |
] << jobConfig | |
organizationFolder(config.name) { | |
displayName(config.displayName) | |
organizations { | |
github { | |
repoOwner(config.owner) | |
apiUri("https://api.github.com") | |
credentialsId("github") | |
} | |
} | |
projectFactories { | |
workflowMultiBranchProjectFactory { | |
scriptPath("Jenkinsfile") | |
} | |
} | |
configure { node -> | |
def traits = node / navigators / 'org.jenkinsci.plugins.github__branch__source.GitHubSCMNavigator' / traits | |
traits << 'jenkins.scm.impl.trait.WildcardSCMSourceFilterTrait' { | |
includes(config.repositories) | |
exludes() | |
} | |
traits << 'org.jenkinsci.plugins.github__branch__source.BranchDiscoveryTrait' { | |
strategyId(1) | |
} | |
traits << 'org.jenkinsci.plugins.github__branch__source.OriginPullRequestDiscoveryTrait' { | |
strategyId(1) | |
} | |
traits << 'org.jenkinsci.plugins.github__branch__source.ForkPullRequestDiscoveryTrait' { | |
strategyId(1) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment