How can I keep the build history of all pipelines on Jenkins?


I really couldn’t find a clear answer to this question, too many people have discussed this issue and generally solved this issue with the plugin.

In my Jenkins environment, build histories (console logs) of my Multibranch pipeline or normal pipelines; I want to keep it forever, how can I do this?

I don’t think there is a global setting here because I couldn’t find it. Going into the pipelines and making “Discard old builds” one by one is a job that really takes a lot of my time and there is a risk of being closed by some developers. How can I keep the history of all pipelines running globally on Jenkins forever?

Best Regards.

You can add code to auto-mark each build as “keep forever” - but in my experience it never worked well - sometimes it will delete things anyway - I would recommend treating your build logs as artifacts and push them to artifact management system