【问题标题】:How to configure proxy settings for one job (using nuget) in TeamCity如何在 TeamCity 中为一项工作(使用 nuget)配置代理设置
【发布时间】:2017-01-13 07:48:04
【问题描述】:

我在 teamcity 有一份使用 MSBuild 的工作:

MSBuild
Build file: build.xml
Targets: Package 

我知道可以为整个 teamcity 服务器配置代理设置,但我只想在此作业中配置代理设置。所以只有这个工作可以使用它们。

此作业使用 NuGet 从 Internet 获取包。这需要通过代理。

我在 CMD 中有第一个构建步骤

tools\Nuget\nuget.exe config -set http_proxy=http://xxx:8080 -ConfigFile .nuget\Nuget.config
tools\Nuget\nuget.exe config -set https_proxy=http:xxx:8080 -ConfigFile .nuget\Nuget.config
tools\Nuget\nuget.exe config -set http_proxy.user=xxx -ConfigFile .nuget\Nuget.config
tools\Nuget\nuget.exe config -set https_proxy.user=xxx -ConfigFile .nuget\Nuget.config
tools\Nuget\nuget.exe config -set http_proxy.password=xxx -ConfigFile .nuget\Nuget.config
tools\Nuget\nuget.exe config -set https_proxy.password=xxx -ConfigFile .nuget\Nuget.config

配置写入NuGet.Config。 sln 指向这个配置。但我仍然收到以下错误:

[Exec] EXEC (502) Bad Gateway.
Exec] E:\TeamCity\buildAgent\xx\build.xml(26, 5): error MSB3073: The command "tools\Nuget\nuget.exe restore myprojectname.sln"

【问题讨论】:

    标签: .net proxy msbuild nuget teamcity


    【解决方案1】:

    您是否考虑过使用像nexus 这样可以免费管理您的存储库的工具?

    然后您可以拥有大量代理存储库并将它们全部链接到虚拟存储库,并且可以成为您用于所有构建的单一来源。

    https://www.sonatype.com/nexus-repository-oss https://books.sonatype.com/nexus-book/reference/confignx-sect-manage-repo.html

    【讨论】:

      猜你喜欢
      • 2011-04-01
      • 1970-01-01
      • 2014-09-21
      • 1970-01-01
      • 1970-01-01
      • 2011-03-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多