Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: core
  • Labels:
    None
  • Environment:
    Platform: All, OS: All

Description

Currently you can configure a job to keep either artifacts of all builds or only
from the latest successful build.

I have a job with quite large artifacts. I want to keep a long build history
(logs and build times). Also I would like to keep the latest 5 artifacts (or so)
to be able to analyze them etc..

For this to work I would like to have an option in the artifacts settings:
Instead of:
[ ] Discard all but the last successful artifact to save disk space
I propose:
[ ] Keep only artifacts of the last [<number>] successful builds to save disk space

Issue Links

Activity

Hide
vijayj added a comment -

I have the same requirement. I don't want to delete the build, because once you
delete the build then you lose all your history then i won't be able to produce
the metrics....etc.

o We also move our artifacts into our centralized server using scp plugin, so
there is no need for hudson to keep them once we moved.
o As the data grow, hudson takes longer to load during the first time.

Show
vijayj added a comment - I have the same requirement. I don't want to delete the build, because once you delete the build then you lose all your history then i won't be able to produce the metrics....etc. o We also move our artifacts into our centralized server using scp plugin, so there is no need for hudson to keep them once we moved. o As the data grow, hudson takes longer to load during the first time.
Hide
mdonohue added a comment -
      • Issue 2144 has been marked as a duplicate of this issue. ***
Show
mdonohue added a comment -
      • Issue 2144 has been marked as a duplicate of this issue. ***
Hide
gliptak added a comment -

Or maybe offer configuration for the number of artifacts to keep. Thanks

Show
gliptak added a comment - Or maybe offer configuration for the number of artifacts to keep. Thanks
Hide
jglick added a comment -

There is now main/test/src/test/java/hudson/tasks/ArtifactArchiverTest.java so
it would not likely be too hard.

Show
jglick added a comment - There is now main/test/src/test/java/hudson/tasks/ArtifactArchiverTest.java so it would not likely be too hard.
Hide
Kohsuke Kawaguchi added a comment -

I think this is also relatively easy to do as a plugin, which allows you to
define a large amount of options for a desirable behavior.

Show
Kohsuke Kawaguchi added a comment - I think this is also relatively easy to do as a plugin, which allows you to define a large amount of options for a desirable behavior.
Hide
mdonohue added a comment -
      • Issue 3343 has been marked as a duplicate of this issue. ***
Show
mdonohue added a comment -
      • Issue 3343 has been marked as a duplicate of this issue. ***
Hide
mdonohue added a comment -
      • Issue 1298 has been marked as a duplicate of this issue. ***
Show
mdonohue added a comment -
      • Issue 1298 has been marked as a duplicate of this issue. ***
Hide
davefollett added a comment -

I would love this feature as part of the Hudson or in a plugin. I just found
out the hard way how much data I am keeping as artifacts and more control over
how long artifacts are kept would be great.

Show
davefollett added a comment - I would love this feature as part of the Hudson or in a plugin. I just found out the hard way how much data I am keeping as artifacts and more control over how long artifacts are kept would be great.
Hide
mdonohue added a comment -
      • Issue 4198 has been marked as a duplicate of this issue. ***
Show
mdonohue added a comment -
      • Issue 4198 has been marked as a duplicate of this issue. ***
Hide
thosor added a comment -

Hello there,
is there something new?.
i have exactly the same requirement.
At the moment i must remove the artifacts manually every week.
Maybe the priority should be set to blocker

Show
thosor added a comment - Hello there, is there something new?. i have exactly the same requirement. At the moment i must remove the artifacts manually every week. Maybe the priority should be set to blocker
Hide
mdonohue added a comment -

Voting for the issue would be a more effective way of getting it attention:
http://issues.hudson-ci.org/secure/ViewIssue.jspa?id=130907&vote=vote

Show
mdonohue added a comment - Voting for the issue would be a more effective way of getting it attention: http://issues.hudson-ci.org/secure/ViewIssue.jspa?id=130907&vote=vote
Hide
Flominator added a comment - - edited

I would also love to have a such a feature.

Some months ago we did a windows batch script, that keeps artifacts of tagged builds and the latest one:

@ECHO OFF
ECHO delete all builds that are not tagged or the latest one
SET JOBSPACE=C:\Dokumente und Einstellungen\Administrator\.hudson\jobs\theproduct\builds

C:
cd "%JOBSPACE%"
for /F "delims=!" %%f in ('dir build.xml /s /b') DO ( REM currently editing %%f
FINDSTR /C:"/tags/" "%%f" > nul
IF ERRORLEVEL 1 (REM echo build was not not tagged
IF /I NOT "%%f"=="%JOBSPACE%%BUILD_ID%\build.xml" (REM echo delete %%~dpfarchive (the corresponding archive folder)
rd /q /s "%%~dpfarchive" 2>nul
)
)
)
ECHO.
exit 0

I think one might take this script and modify it to delete the last n builds

Show
Flominator added a comment - - edited I would also love to have a such a feature. Some months ago we did a windows batch script, that keeps artifacts of tagged builds and the latest one: @ECHO OFF ECHO delete all builds that are not tagged or the latest one SET JOBSPACE=C:\Dokumente und Einstellungen\Administrator\.hudson\jobs\theproduct\builds C: cd "%JOBSPACE%" for /F "delims=!" %%f in ('dir build.xml /s /b') DO ( REM currently editing %%f FINDSTR /C:"/tags/" "%%f" > nul IF ERRORLEVEL 1 (REM echo build was not not tagged IF /I NOT "%%f"=="%JOBSPACE%%BUILD_ID%\build.xml" (REM echo delete %%~dpfarchive (the corresponding archive folder) rd /q /s "%%~dpfarchive" 2>nul ) ) ) ECHO. exit 0 I think one might take this script and modify it to delete the last n builds
Hide
scm_issue_link added a comment -

Code changed in hudson
User: : abayer
Path:
trunk/hudson/main/core/src/main/java/hudson/model/Run.java
trunk/hudson/main/core/src/main/java/hudson/tasks/LogRotator.java
trunk/hudson/main/core/src/main/resources/hudson/tasks/LogRotator/config.jelly
trunk/hudson/main/test/src/test/java/hudson/tasks/ArtifactArchiverTest.java
trunk/hudson/main/test/src/test/java/hudson/tasks/LogRotatorTest.java
trunk/www/changelog.html
http://hudson-ci.org/commit/28293
Log:
[FIXED HUDSON-834] Added advanced option to delete artifacts without deleting the rest of the build

Show
scm_issue_link added a comment - Code changed in hudson User: : abayer Path: trunk/hudson/main/core/src/main/java/hudson/model/Run.java trunk/hudson/main/core/src/main/java/hudson/tasks/LogRotator.java trunk/hudson/main/core/src/main/resources/hudson/tasks/LogRotator/config.jelly trunk/hudson/main/test/src/test/java/hudson/tasks/ArtifactArchiverTest.java trunk/hudson/main/test/src/test/java/hudson/tasks/LogRotatorTest.java trunk/www/changelog.html http://hudson-ci.org/commit/28293 Log: [FIXED HUDSON-834] Added advanced option to delete artifacts without deleting the rest of the build
Hide
abayer added a comment -

This will be live in 1.350.

Show
abayer added a comment - This will be live in 1.350.
Hide
Flominator added a comment -

Where exactly can I find the new option?

Show
Flominator added a comment - Where exactly can I find the new option?
Hide
allenr added a comment -

@flominator, Go to project configuration, check "Discard Old builds", Click "Advanced", you'll see "Days to keep artifacts" and "Max # of builds to keep with artifacts".

Outstanding functionality, I'm so happy to see this in here finally

Show
allenr added a comment - @flominator, Go to project configuration, check "Discard Old builds", Click "Advanced", you'll see "Days to keep artifacts" and "Max # of builds to keep with artifacts". Outstanding functionality, I'm so happy to see this in here finally

People

  • Assignee:
    abayer
    Reporter:
    gradopado
Vote (22)
Watch (8)

Dates

  • Created:
    Updated:
    Resolved: