Do not mirror official NuGet feed
Setting up a NuGet server with TeamCity was a real treat. Almost everthing works as exepcted, but I have one question about our setup.
It seems that the TeamCity feed replicates the official feed. NuGet Package Explorer and VS both show all official packages as well when accessing the TC feed. Is there a way to turn this behaviour off, so I get to see only our own packages on the TC feed?
Please sign in to leave a comment.
TeamCity does not have any login for proxing feeds. Meanwhile, all .nupkg files that are found under build artifacts are included to the feed. It looks like you may see only those packages.
Ok, thanks for you reply. I must be running into some other issue, I guess, maybe related to VS.
For reference purposes, I'll still illustrate the scenario. This is the situation:
Now with VS or Package Explorer, if I query the feeds, I get:
So the Some.Official.Package seems to be on the TeamCity feed, while it's actually not. It's impossible to get a filtered list that only show the packages local to TeamCity. Also note that I don't have this problem with the Network Share which obviously does not run as a real NuGet svc.
You may consider openinig
http://TEAMCITY/httpAuth/app/nuget/v1/FeedService.svc/Packages()
To see the full list of packages that are registered in TeamCity feed.
It does contain a lot of official packages. Hmm... it's starting to look like TC is not only picking up all packages being built, but also their dependencies. Not sure about this yet, though.
It is.
For every finished build, TeamCity scans it's build artifacts. All .nupkg files that were published are scanned and included into the feed.
So I guess I'm up to a search for the origin of these packages. Does TC also look into zips, and is there anyway to ignore the packages on a specific build?
Zip files are not unpacked during the search. So you may simply pack all dependencies as .zip fles to avoid them being published to the feed
I really appreciate your quick and thorough feedback!
I still have to investigate to make sure, but the packages I'm seeing in the feed can hardly be unzipped artifacts on some build. Will let you know if I'm 100% sure.
I've yet been unable to find any build that contains the packages that are in our TC feed.
I've found the culprit. It was an old build that ran before we used TC's NuGet feed. It picked up artifacts on all nupkg files that were on our custom NuGet feed.
(Is there any way to detect how TC picks up these artifacts? e.g. which TC log should I inspect and what should I look for?)