Issues using build discarder with Multi-branch pipeline

37 views
Skip to first unread message

Bartłomiej Siwek

unread,
Aug 14, 2024, 2:34:16 PM8/14/24
to Jenkins Users
Hello everyone,

At the company I work for we have a project setup to build in Jenkins via a Multi-branch pipeline. In that pipelines Jenkins file we have specified a LogRotator discarder as follows:
options
{
    buildDiscarder(logRotator(numToKeepStr: '-1', daysToKeepStr: '14', artifactNumToKeepStr: '-1', artifactDaysToKeepStr: '3'))
}

This works really well for the branches that are built regularly, but people often will trigger a build of their own branch once to make sure everything is okay, merge the branch, but leave the original one hanging around.

As a result we have branches that were build a few months back that have a single build associated with them that still has all the artifacts and logs intact.

I can't influence that people remove their branches, but it seems to me that Jenkins should still delete old builds and artifacts, but it does not.

In the Jenkins configuration under "System" and "Global Build Discarders" we have " Project Build Discarder" added.

Is this a bad configuration of the discarder? Or Jenkins? Or a bug?

Best Regards,
Bart Siwek
Reply all
Reply to author
Forward
0 new messages