0
votes

I have a teamcity installation running on a windows server

I have a build process, that is building a .net application. As part of the build process it is running a gulp task, and is installing various node modules to build all the sass and js files.

Within my teamcity solution i have my clean up rules for "Everything" to be older that the 4th-th successful build

However teamcity does not appear to be cleaning everything up, because my artifacts folder is massive ( and caused the server to run out of disk space )

Now I believe that the issue is because one of the gulp task and all the node_modules being installed. Because of how nested node installs everything.

On windows machines, in most instances you cannot just delete a node_modules folder as you get the path longer than 256 char warning, and you have to use the robocopy trick of copying across an empty folder to delete the node_modules folder

What have others done to resolve this problem of artifacts not being correctly cleaned up ?

I was thinking about another step that would delete the node_modules folder from the artifact folder after the step to process the gulp tasks, but I cannot see in the list of teamcity parameters once that points to the artifact folder for the current build.

1
Have you considered to use the Swabra Build Feature ?Didier Aupest
It's a bit unclear if the issue is with TeamCity clean-up not trying to delete the builds (I've addressed that in my answer), trying but failing to delete the artifacts (teamcity-server.log should have errors on that), or the files piling up on the agent machine (in which case it's up to your build to delete the files). BTW, it's better to publish archives as artifacts instead of many files separately - it's faster and usually easier to use this way.Yaegor

1 Answers

0
votes

If the builds should be deleted by the server clean-up, but you still see the builds in TeamCity UI and they are not pinned, the most common reason for that is having other builds snapshot- or artifact-depending on the builds in question. Check build's Dependencies tab and related TeamCity settings.