首页 文章

如何将包发布到TeamCity nuget服务器?

提问于
浏览
9

我们为nuget配置了TeamCity 7服务器 . 它'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'已尝试发布http://teamcity:port/guestauth/app/nuget/v1/FeedService.svc的变种但到目前为止没有运气 .

谢谢,安迪

3 回答

  • 0

    “解决方法是创建一个构建配置,将这些包作为工件发布 . ”

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

  • 1
  • 9

    我们以前遇到过同样的问题,实际的解决方案是创建一个构建配置,正如@Robert所说 . 但是teamCity免费版本有20个构建配置限制,有时你不想在单个Nuget包中使用它们,所以我们的解决方法是:

    • 您需要对TeamCity Server的packages文件夹具有写入权限 .

    • 使用适当的权限为packages文件夹创建共享文件夹 .

    • 在项目文件夹中,使用以下语句创建.cmd文件:

    set output = \ teamcityserver \ Packages
    <nuget.exe path> \ nuget pack“MyProject.csproj”-o%output%-build -Properties Configuration = Release

    所以关键是将项目直接打包到服务器包文件夹 .

    如果您在解决方案中有几个nuget包,只需为每个包重复“nuget pack”行,您就完成了 . 游出nuget.exe的路径并正确更改它 .

    我还没有尝试在最后一个TeamCity版本中发布 .

相关问题