您能否在属于另一个 VSTS 帐户的 VSTS 提要中恢复包?
Can you restore packages in a VSTS feed that belongs to another VSTS account?
我的公司有很多 Visual Studio Team Services 帐户。我们有一个用于内部开发,一个用于我们的每个客户。我们在我们的内部开发帐户 (https://{dev-account}.visualstudio.com/DefaultCollection
) 中托管我们的内部 nuget 库,我想在 运行 在客户帐户 (https://{client-account}.visualstudio.com/DefaultCollection
) 中构建时恢复包。
我使用 bootstrap tools 设置了存储库,并在我的 VSTS 构建中添加了一个批处理脚本构建步骤来执行 init.cmd
。这工作正常,但是,下一步是 NuGet 包还原,它无法在开发帐户的 NuGet 提要中找到包:
2016-03-22T23:34:37.5398840Z Please provide credentials for:
https://{dev-account}.pkgs.visualstudio.com/DefaultCollection/_packaging/{my-feed}/nuget/v3/index.json
2016-03-22T23:34:37.5408842Z UserName: Password: WARNING: Unable to
find version '1.9.0.10' of package '{my-package}'.
这是有道理的,因为提要位于单独的 VSTS 帐户中,并且构建代理没有访问提要的权限。
这附近有没有?我知道 MyGet,它提供免费 public 提要,但我想尽可能使用 VSTS。
我对这个解决方案并不满意,但它确实有效。您可以在 nuget.config:
中存储包源的凭据
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<clear />
<add key="repositoryPath" value="packages" />
</config>
<packageSources>
<!-- When <clear /> is present, previously defined sources are ignored -->
<!-- Remove this tag or un-comment the nuget.org source below to restore packages from nuget.org -->
<!-- For more info, see https://docs.nuget.org/consume/nuget-config-file -->
<clear />
<add key="vss-package-management" value="https://www.myget.org/F/vss-package-management/api/v2" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="{dev-account}" value="https://{dev-account}.pkgs.visualstudio.com/DefaultCollection/_packaging/{feed}/nuget/v3/index.json" />
</packageSources>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
<packageSourceCredentials>
<{dev-account}>
<add key="Username" value="username" />
<add key="ClearTextPassword" value="password" />
</{dev-account}>
</packageSourceCredentials>
</configuration>
我的公司有很多 Visual Studio Team Services 帐户。我们有一个用于内部开发,一个用于我们的每个客户。我们在我们的内部开发帐户 (https://{dev-account}.visualstudio.com/DefaultCollection
) 中托管我们的内部 nuget 库,我想在 运行 在客户帐户 (https://{client-account}.visualstudio.com/DefaultCollection
) 中构建时恢复包。
我使用 bootstrap tools 设置了存储库,并在我的 VSTS 构建中添加了一个批处理脚本构建步骤来执行 init.cmd
。这工作正常,但是,下一步是 NuGet 包还原,它无法在开发帐户的 NuGet 提要中找到包:
2016-03-22T23:34:37.5398840Z Please provide credentials for: https://{dev-account}.pkgs.visualstudio.com/DefaultCollection/_packaging/{my-feed}/nuget/v3/index.json
2016-03-22T23:34:37.5408842Z UserName: Password: WARNING: Unable to find version '1.9.0.10' of package '{my-package}'.
这是有道理的,因为提要位于单独的 VSTS 帐户中,并且构建代理没有访问提要的权限。
这附近有没有?我知道 MyGet,它提供免费 public 提要,但我想尽可能使用 VSTS。
我对这个解决方案并不满意,但它确实有效。您可以在 nuget.config:
中存储包源的凭据<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<clear />
<add key="repositoryPath" value="packages" />
</config>
<packageSources>
<!-- When <clear /> is present, previously defined sources are ignored -->
<!-- Remove this tag or un-comment the nuget.org source below to restore packages from nuget.org -->
<!-- For more info, see https://docs.nuget.org/consume/nuget-config-file -->
<clear />
<add key="vss-package-management" value="https://www.myget.org/F/vss-package-management/api/v2" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="{dev-account}" value="https://{dev-account}.pkgs.visualstudio.com/DefaultCollection/_packaging/{feed}/nuget/v3/index.json" />
</packageSources>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
<packageSourceCredentials>
<{dev-account}>
<add key="Username" value="username" />
<add key="ClearTextPassword" value="password" />
</{dev-account}>
</packageSourceCredentials>
</configuration>