multibranchPipelineJob('simple-spring-boot') { description("") branchSources { branchSource { source { github { repoOwner('me') repository('simple-springboot') apiUri(url) credentialsId("---") buildOriginBranch(true) traits { headWildcardFilter { includes('master development *PC-* *HD-* *SLR-*') excludes('PR') }
gitHubCommitSkipTrait() } } }
buildStrategies { ignoreCommitterStrategy { ignoredAuthors("jenkins") allowBuildIfNotExcludedAuthor(true) } }
strategy {
namedExceptionsBranchPropertyStrategy { defaultProperties { buildRetentionBranchProperty { buildDiscarder { logRotator { daysToKeepStr("10") numToKeepStr("10") artifactDaysToKeepStr("-1") artifactNumToKeepStr("-1") } }
} noTriggerBranchProperty()
} namedExceptions { named { name("master production") props { buildRetentionBranchProperty { buildDiscarder { logRotator { daysToKeepStr("10") numToKeepStr("10") artifactDaysToKeepStr("-1") artifactNumToKeepStr("-1") } } } noTriggerBranchProperty() }
} } } } } } triggers { periodic(1440) }
orphanedItemStrategy { discardOldItems { daysToKeep(1) // remove merged pipelines every day } }
configure { def traits = it / sources / data / 'jenkins.branch.BranchSource' / source / traits traits << 'org.jenkinsci.plugins.github__branch__source.BranchDiscoveryTrait' { strategyId(3) }// traits << 'org.jenkinsci.plugins.github__branch__source.OriginPullRequestDiscoveryTrait' {// strategyId(1)// }//// traits <<//// } }}