| The output of your script is attached as file. jenkins-script-output.txt The seed jobs looke similar to:
def createBuildPipeline(folderPath, projectName, pipelineName = BUILD_DIR) {
def repoGit = Constants.getSCMRepo(projectName)
def repoHttp = Constants.getHTTPRepo(projectName) folder(folderPath) {
description("Bla bla")
} // Build Jobs
multibranchPipelineJob(folderPath + pipelineName) {
description("Bla bla")
branchSources {
def uniqueId = "${folderPath}-${projectName}-${pipelineName}"
git {
id(uniqueId)
remote(repoGit)
credentialsId(JENKINS_CREDENTIALS_ID)
}
}
triggers {
periodicFolderTrigger{
interval(SCAN_REPO_AFTER_MINUTES)
}
} orphanedItemStrategy {
// Trims dead items by the number of days or the number of items.
discardOldItems {
// Sets the number of days to keep old items.
daysToKeep(DELETED_BRANCHES_KEEP_DAYS)
// Sets the number of old items to keep.
numToKeep(DELETED_BRANCHES_KEEP_NUMBER)
}
} configure { node ->
node / 'sources' / 'data' / 'jenkins.branch.BranchSource' {
source(class: 'jenkins.plugins.git.GitSCMSource') {
remote(repoGit)
credentialsId(JENKINS_CREDENTIALS_ID)
includes('*')
excludes()
ignoreOnPushNotifications('false')
} // this property prevents scanning the pipeline from triggering builds of all branches
strategy(class: 'jenkins.branch.DefaultBranchPropertyStrategy') {
properties(class: 'java.util.Arrays$ArrayList') {
a(class: 'jenkins.branch.BranchProperty-array') {
'jenkins.branch.NoTriggerBranchProperty'()
}
}
}
} }
}
}
I mean, there is the possibility that this was not the fault of the build discarder but some other feature (Gitlab cough). Still the fact remains that after the upgrade, where I upgraded Jenkins and the plugins, I had to rebuild all branches because the old builds where gone. Maybe there was even a bug in the old discarding handling and the fix caused this. |