Skip to content

Commit

Permalink
cb
Browse files Browse the repository at this point in the history
  • Loading branch information
aaradhak committed Jan 23, 2025
1 parent ff0ccd1 commit 2b3a4c7
Showing 1 changed file with 36 additions and 21 deletions.
57 changes: 36 additions & 21 deletions jobs/seed-github-ci.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,6 @@ node { repos.each { repo ->
repository('${name}')
checkoutCredentialsId("github-coreosbot-token-username-password")
scanCredentialsId("github-coreosbot-token-username-password")
traits {
branchDiscovery {
strategyId(1)
}
originPullRequestDiscovery {
strategyId(1)
}
forkPullRequestDiscovery {
strategyId(1)
trust(class: 'org.jenkinsci.plugins.github_branch_source.ForkPullRequestDiscoveryTrait\$TrustContributors')
}
}
}
}
factory {
Expand All @@ -55,22 +43,49 @@ node { repos.each { repo ->
orphanedItemStrategy {
discardOldItems()
}
buildStrategies {
skipInitialBuildOnFirstBranchIndexing()
changeRequest {
ignoreTargetOnlyChanges(true)
}
}
triggers {
periodicFolderTrigger {
// manually rescan once a day; this is important so that it
// picks up on deleted branches/PRs which can be cleaned up
interval((60 * 24).toString())
}
}
branchProperties {
durabilityHint {
hint('PERFORMANCE_OPTIMIZED')
// things which don't seem to have a nice DSL :(
configure {
it / sources / data / 'jenkins.branch.BranchSource' / strategy {
properties(class: 'java.util.Arrays\$ArrayList') {
a(class: 'jenkins.branch.BranchProperty-array') {
'org.jenkinsci.plugins.workflow.multibranch.DurabilityHintBranchProperty' {
// we don't care about durability for these CI
// jobs. we should be able to interrupt and
// restart from scratch whenever
hint('PERFORMANCE_OPTIMIZED')
}
}
}
}
it / sources / data / 'jenkins.branch.BranchSource' / source << {
traits {
'org.jenkinsci.plugins.github__branch__source.BranchDiscoveryTrait' {
strategyId(1)
}
'org.jenkinsci.plugins.github__branch__source.OriginPullRequestDiscoveryTrait' {
strategyId(1)
}
'org.jenkinsci.plugins.github__branch__source.ForkPullRequestDiscoveryTrait' {
strategyId(1)
// allow testing of PRs from project contributors
trust(class: 'org.jenkinsci.plugins.github_branch_source.ForkPullRequestDiscoveryTrait\$TrustContributors')
}
}
}
it / sources / data / 'jenkins.branch.BranchSource' / buildStrategies {
'jenkins.branch.buildstrategies.basic.ChangeRequestBuildStrategyImpl' {
ignoreTargetOnlyChanges(true)
}
'jenkins.branch.buildstrategies.basic.SkipInitialBuildOnFirstBranchIndexing' {
// Avoid triggering builds during the first branch indexing
}
}
}
}
Expand Down

0 comments on commit 2b3a4c7

Please sign in to comment.