I removed old build folders from the build directory in Jenkins expecting them to be removed in the UI, unfortunately whilse these build directories are gone, their UI link still exists. I now have two questions:
The global build discarder settings can be accessed from Manage Jenkins -> Configure System -> Global Build Discarders . The default "Project Build Discarder" requires a project to have the "Discard Old Builds" setting configured.
2) If you don't have access to the “Manage Jenkins” section of your Jenkins, there is another way to remove old builds i.e. using a “discard-old-build” plugin where you can specify how many builds you want to keep and all older builds are discarded.
You can remove a build by deleting the named directory on the master under $HUDSON_HOME/jobs/job-name/builds/42 (though that's from memory, so might not be exact). If you just want to remove the artifacts, remove the archive subdirectory.
There is a way to clean up a workspace in Jenkins. You need to install the Workspace Cleanup Plugin. This plugin can clean up the workspace before build or after a build. Under Build Environment, check the box that says Delete workspace before build starts.
A better way to remove old builds is discard-old-build plugin where you can specify how many builds you want to keep and all older builds are discarded.
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