17

We're using team city as a nuget server and the artifact cleaning is removing old nuget packages. Unfortunately some of our packages aren't built that often, and when they get cleaned up other builds break.

I've tried changing the clean up rules to exclude *.nupkg, but this doesn't seem to be working.

Any ideas?

jonnii
  • 28,019
  • 8
  • 80
  • 108
  • 8
    I don't think so, teamcity is a build tool, I think that's stackoverflow worthy. – jonnii Nov 14 '12 at 03:29
  • 1
    Did you get a resolution to this. Experiencing the same issue using the ant pattern -:**/*.nupkg but builds are being cleaned up. – Bronumski Sep 26 '17 at 15:30

2 Answers2

4

I don't know about the version of TC you were using when this was posted, but in version 7 and up there is a place to set rules for clean ups.

By setting -:*.nupkg you can exclude NuGet packages from the cleanup process.

Logarr
  • 2,120
  • 1
  • 17
  • 29
  • 2
    I think you want -:**/*.nupkg to traverse all directories instead of just getting *.nupkg files in the root per: http://stackoverflow.com/questions/33417655/ant-pattern-matching-vs/33421521#33421521 – jakejgordon Oct 29 '15 at 18:19
1

In TeamCity's Build History Clean-up options, near the bottom you'll find a Dependencies category with an option to prevent cleanup of builds that other build configurations depend on. I think that will solve your problem.

KevinF
  • 133
  • 1
  • 8
  • 2
    Package builds don't have any builds that depend on them directly (they are different build chains). The problem manifests when someone relies on a package that isn't the latest version and is over the cleanup threshold. – jonnii Nov 28 '12 at 04:08