How can packages be published to a TeamCity nuget server?

北慕城南 提交于 2019-12-08 16:10:29

问题


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


回答1:


"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/




回答2:


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




回答3:


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.



来源:https://stackoverflow.com/questions/10423272/how-can-packages-be-published-to-a-teamcity-nuget-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!