When scanning my multibranch pipeline, I am expecting old branches that are deleted from bitbucket to get deleted in Jenkins. This is the output of scanning my pipeline:
Evaluating orphaned items in *****
Will remove ****
Will remove ****
Finished: NOT_BUILT
But it doesn't remove the branches.
I have Prune setup and orphaned setting are all set to empty
Edit:
Tried to add extensions: [[$class: 'PruneStaleBranch']]
to my checkout step, it still doesn't remove old branches
Update to Jenkins 2.474 and use removeLastBuild
argument:
options {
buildDiscarder(logRotator(numToKeepStr: '2', daysToKeepStr: '7', removeLastBuild: true))
}
This was fixed in JENKINS-68822
In older Jenkins, last successful build would never be removed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With