0

I have a Jenkins script with daysToKeepStr param .

options { buildDiscarder(   logRotator(
    numToKeepStr:'5',
    daysToKeepStr: '7',
    ) )

daysToKeepStr: discard the builds after 7 days .

But I see in jenkins for every branch one build is still remaining after 7 days . Having 100+ branches consuming lot of storage due to the build being not discarded.

Can someone suggest How to discard all the builds after specific no of days

  • Pretty sure that a) build discarded does not run until the next time job is invoked AFTER the settings are changed and b) it always leaves the last build log, regardless of timeframe. Not sure how that applies to a multi-branch build.y You could write your own groovy iterator. What happens when you merge/delete the branches in the repo? – Ian W Nov 04 '22 at 01:17

0 Answers0