nugetteamcity-9.0nuget-server

push NuGet packages to TeamCity NuGet server


I have turned on TeamCity's NuGet Server and I want to push in common packages (i.e. from public sources such as NuGet.org) because the build server cannot see outside our company, so restoring packages on the build server from NuGet.org is not possible.

I cannot see how to push these packages on to our TeamCity server. I've seen various answers suggesting to use a package build still or some other means of publishing from within a build, but this is not appropriate for my use case.

If I try to publish from a command line it complains that it cannot find an API key (where do I get that from?) and it won't allow me to enter my credentials (I assume my team city login would be it) as it tells me "Cannot prompt for input in non-interactive mode." (I didn't set that mode and I can't see how to turn that off).

So, how do I push/publish an adhoc package that I obtained elsewhere into team city?


Solution

  • I believe that the nuget functionality provided by TeamCity is an API added on top of TeamCity's builtin artifact functionality.

    There are a number of consequences of that:

    There is however as far as I know no implementation in the Teamcity Nuget API for pushing packages to it. The general practice for storing original or generated packages is to use a stand alone nuget server or service like a normal file share, a Nuget.Core based server, proget or myget.org.

    Update: If you end up with many packages of your own I've heard people reporting that Teamcity becomes quite slow when the clients are resolving the packages.

    Update 2: The last years I've adopted the notion of separating build artifact packages into the two categories library package and deployment package. A separate package repository can be used for both types but a repository such as the one available in for instance Octopus deploy should only be used for deployment packages.

    Update 3: Microsoft have a page for a number of nuget server options.