Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete unneeded build artifacts in Hudson

Tags:

maven-2

hudson

I have a Hudson CI server which is building a making a maven build. A parent project with two sub projects. One of maven subprojects creates a rather large .war (10MB) file which is stored for every build. I'd like to get rid of that .war file to save disk space, but I'd like to store everything else the Hudson build stores in history (test results, graphs etc.).

The .war file is stored under jobs/PROJECT_NAME/modules/PACKAGE_NAME$SUB_PROJECT_NAME/builds/2009-12-23_11-59-11/archive/PACKAGE_NAME/SUB_PROJECT_NAME/1.0/SUB_PROJECT_NAME-1.0.war

I have tried using job configuration according to this SO question namely Archive the artifacts and Discard all but the last successful/stable artifact to save disk space. But that actually does following:

  1. An additional copy is stored for two last build under jobs/PROJECT_NAME/builds/2009-12-29_17-23-39/archive/PROJECT_NAME/web/target/PROJECT_NAME-web-1.0.war . So it actually increases disk space consumption a bit.
  2. Web page for this hudson jobs contains links to .war files in the two last builds.

My build just executes clean install goals against parent pom.xml.

So how to configure Hudson server and/or Maven to remove build artifacts automatically from under jobs/PROJECT_NAME/modules and leave them under jobs/PROJECT_NAME/builds?

like image 379
Juha Syrjälä Avatar asked Dec 30 '09 11:12

Juha Syrjälä


1 Answers

I use post build task to do some files copy/delete stuff.

like image 148
Ben Avatar answered Sep 28 '22 07:09

Ben