CruiseControl.Net: How Does One Clear Obsolete Build History?
Asked Answered
R

5

8

I just started using CCNet, and in the process of getting my build projects set up I racked up a lot of build history from trial and error. I really don't want to keep that old stuff around, but I can't seem to see where/how to get rid of it. I'm sure this is a silly question, and I apologize if I'm overlooking something that should be obvious. I did RTM and Google for about a half hour, and poked around my CCNet installation, but it's not jumping out at me. I deleted the state files for the projects (don't know if that has anything to do with it), but the old builds are still there if I drill into a project's stats from the dashboard. Any suggestions? Thanks.

Answered: I had explicitly set the artifacts directory to a location that was not under the CCNet server directory and consequently never looked in it again... went looking and, disco, there's the build histories.

Rubefaction answered 24/11, 2008 at 22:51 Comment(0)
J
5

Assuming you have a project called "Dev" and you've installed CCNet into the default location, you'll have a folder called:

c:\Program Files\CruiseControl.NET\server\Dev

and a Dev.state file in:

c:\Program Files\CruiseControl.NET\server

Just delete both the folder and the state file.

Judenberg answered 24/11, 2008 at 23:5 Comment(2)
Doh! I had explicitly set the artifacts directory to a location that was not under the CCNet server directory and consequently never looked in it again... went looking and, disco, there's the build histories.Rubefaction
This might be slightly out of date - I found no "Dev" folder under ..\server\. It was sufficient to: 1) stop the cruisecontrol.net service 2) delete the Dev.state file 3) restart the service 4) force a build to eliminate the "Unknown" Last build time.Intemperance
J
11

Don't forget you can use Artifact Cleanup Publisher to keep your build history from growing to the size of Mars over time.

Jigger answered 26/1, 2011 at 14:29 Comment(1)
I believe this is the best answer, because deleting the entire folder differs from smart cleaning, which this publisher actually does.Georgettageorgette
J
5

Assuming you have a project called "Dev" and you've installed CCNet into the default location, you'll have a folder called:

c:\Program Files\CruiseControl.NET\server\Dev

and a Dev.state file in:

c:\Program Files\CruiseControl.NET\server

Just delete both the folder and the state file.

Judenberg answered 24/11, 2008 at 23:5 Comment(2)
Doh! I had explicitly set the artifacts directory to a location that was not under the CCNet server directory and consequently never looked in it again... went looking and, disco, there's the build histories.Rubefaction
This might be slightly out of date - I found no "Dev" folder under ..\server\. It was sufficient to: 1) stop the cruisecontrol.net service 2) delete the Dev.state file 3) restart the service 4) force a build to eliminate the "Unknown" Last build time.Intemperance
I
2

What you're looking for are the "artifacts" folders. Check your ccnet.config file for the tag

Stop your service, delete the artifact directory folder, and restart your service.

Infiltration answered 22/12, 2009 at 23:44 Comment(0)
A
1

The logs are stored in the artifacts directories under artifacts\MyProjectName\Build\log*.xml.

The State file stores things like the last build date, time, info.

Best to stop the service, and then delete the .state in ProgFiles\CC.net\server and also delete the artifacts\MyProjectName\Build\log.xml files.

Antihelix answered 9/7, 2010 at 23:15 Comment(0)
F
0

As mentioned above, use the Artifact Cleanup Publisher to keep the number of artifacts to a sensible level.

If you have a lot of projects and need to do a retrospective cleanup, you could use the following Powershell script to remove old log files:

$limit = (Get-Date).AddDays(-60)

get-childitem -Path D:\Builds -filter MatchMyProjects.* | %{ 
    $projectPath=$_.FullName
    $logsPath=$projectPath + "\Logs"    
    write-host Removing logs from folder $logsPath
    Get-ChildItem -Path $logsPath -Force -Filter *.xml | Where-Object { !$_.PSIsContainer -and $_.CreationTime -lt $limit } | Remove-Item -Force
}

Thanks to this answer: Delete files older than 15 days using PowerShell

Ferdie answered 14/11, 2014 at 12:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.