Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove old builds in jenkins? [duplicate]

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:

  1. How can I get rid of the defunct links in the UI?
  2. How can I delete old build from cli and have it reflected in the UI?
like image 691
Dark Star1 Avatar asked Nov 06 '15 15:11

Dark Star1


People also ask

How do I get rid of old builds in Jenkins?

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.

How do I remove old builds in Jenkins pipeline?

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.

How do I get rid of Jenkins keep this build forever?

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.

How do I clean up Jenkins?

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.


1 Answers

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.

like image 180
Devesh Avatar answered Sep 22 '22 13:09

Devesh