Tiago
Tiago

Reputation: 125

"Delete Build in Jenkins after Keep Forever"

I've used the Simple Promote Plugin in Jenkins and it set my build to "keep this build forever".

Is there any way I can delete it?

I got access to the slave who build it and to the master (tried to find anything related in there but no luck).

Upvotes: 11

Views: 12415

Answers (6)

David Newcomb
David Newcomb

Reputation: 10943

Not sure about masters and slaves, but there is an answer here that allowed me to delete a build "explicitly marked to be kept".

List all keep-forever builds in Jenkins?

Upvotes: 0

Cristian Florescu
Cristian Florescu

Reputation: 1816

In order to delete builds marked "keep this forever" you should change that flag to opposite state.

Please follow next steps

  1. Open within a text editor $HUDSON_HOME/jobs/job-name/builds/xx/build.xml

  2. Change

    <keepLog>true</keepLog> to <keepLog>false</keepLog>

  3. Go to Manage Jenkins -> Reload Configuration from Disk

After these steps you will be able to delete build marked as "keep this forever"

Upvotes: 6

MichalT
MichalT

Reputation: 49

Please remember that "Don't keep this build forever" button will only appear when you enable "Discard Old Builds" inside job configuration. I am not sure if it affects Simple Promote Plugin, but it work in this way with 'Release Plugin'.

MichalT

Upvotes: 1

Fiodor Kupchik
Fiodor Kupchik

Reputation: 21

I think that the final (and may be the only one step) to completely delete build from Hudson's history is to modify "nextBuildNumber" file placed in job directory.

Upvotes: 1

Francisco Passos
Francisco Passos

Reputation: 320

Just as Christopher said, you can remove the build just by deleting the build directory on the master, inside the job directory.

However if you access the page again, the build data gets dumped to disk again. So you either shut down Hudson first, or you go to the Hudson management console and 'Reload Configuration from Disk' which basically discards whatever's in memory and reloads from your config files.

Just make sure you do it right after deleting the folder.

Upvotes: 7

Christopher Orr
Christopher Orr

Reputation: 111575

I'm not sure whether (or how) the Simple Promote Plugin affects this at all, but can't you just click the button that says "Don't keep this build forever", followed by "Delete"?

When a build is marked as "keep forever" (and the padlock icon shows next to the build), you should be able to "unlock" it by pressing that "Don't keep..." button on the build page.

Upvotes: 18

Related Questions