I'm using Jenkins to execute daily tasks with my projects, but every execution, Jenkins stores a 20MB dir in PROJECT_HOME/builds, so after a lot of executions, the space in the disk of every project is huge (10GB for some Jenkins tasks).
It isn't very important for me to store the result of the previous executions, so what I want to know is that if exists a way to say Jenkins no to store that information.
Does anybody know how to avoid Jenkins to store result of old executions?
If you need to clean the Jenkins build history, and reset the build number back to 1, you can run a simple script in Jenkins Script Console. Go to Jenkins Script Console. Go to your Jenkins home page -> Manage Jenkins -> Script Console. Run this script to clean and reset.
There's a lot you can break using the script console. Delete the builds' folders from disk (by default in $JENKINS_HOME/jobs/JobName/builds/ , using the start time stamp as folder name) and restart Jenkins, or Reload Configuration From Disk.
You can see project list with occupied disk space by going to the "Disk Usage" page in the management section (Dashboard -> "Manage Jenkins" -> "Disk Usage"). The same page also allows you to schedule disk usage calculation immediately.
If you go into the project's configuration page, you will find a checkbox labeled "Discard Old Builds". Enabling this allows you to specify both the number of days to retain builds for and the maximum number of builds to keep.
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