How can packages be published to a TeamCity nuget server?
Asked Answered
L

3

9

We have a TeamCity 7 server configured for nuget. It's hosted on a machine with no external connectivity. Is it possible to publish packages to the TeamCity nuget server? For example, if we want to add a log4net package dependency to one of our projects, it needs to be published to the TeamCity server, as nuget.org is unreachable. So far, I've tried publishing to variations on http://teamcity:port/guestauth/app/nuget/v1/FeedService.svc but no luck so far.

Thanks, Andy

Leaden answered 2/5, 2012 at 23:48 Comment(0)
J
9

"The workaround is to create a build configuration that publishes those packages as artifacts."

http://blogs.jetbrains.com/teamcity/2011/12/01/setting-up-teamcity-as-a-native-nuget-server/

Jackquelin answered 4/5, 2012 at 1:50 Comment(1)
i see, thanks for spotting that! hopefully they can resolve this at some point.Leaden
L
1

ack, not supported yet: http://devnet.jetbrains.net/message/5456081#5456081

Leaden answered 3/5, 2012 at 0:2 Comment(0)
S
0

We had the same issue before, and the actual solution is to create a build configuration, as @Robert said. But teamCity free version has a 20 build configurations limit, and sometimes you don't want to use them in single Nuget packages, so our workaround was:

  • You need write access to the packages folder at TeamCity Server.
  • Create a shared folder to the packages folder with proper permissions.
  • In the project folder, create a .cmd file with the statements:
set output=\\teamcityserver\Packages
<nuget.exe path>\nuget pack "MyProject.csproj" -o %output% -build -Properties Configuration=Release

So the key is to package the projects directly to the server packages folder.

If you have several nuget packages in the Solution, just repeat the "nuget pack" line for each one, and you're done. Wacht out the path to nuget.exe and change it properly.

I haven't tried to publish in the last TeamCity version either.

Sosna answered 30/1, 2013 at 16:10 Comment(2)
Sergi, where is this TeamCity \Packages directory? In the TeamCity Data Directory I see directories \backup, \config, \lib, \plugins, and \system. Where specifically within those is this directory?Range
I guess I mixed some concepts... what we actually did was directly publishing to our own Nuget Server... not the TeamCity one... so, sorry for the confusion...Sosna

© 2022 - 2024 — McMap. All rights reserved.