TeamCity 配置无法从 TeamCity NuGet 源恢复
TeamCity Configuration Can't Restore From TeamCity NuGet Feed
我正在设置一些 CI 构建配置,需要一些 NuGet 包。这些 NuGet 包构建在同一台服务器上,这很好。我读到我可以使用 TeamCity 的 NuGet 提要来满足我的要求。我一直在关注 this 指南。
我在 Build
项目上创建了提要,该项目生成了 v1
、v2
和 v3
端点。对于索引包,我选择了第一个选项,即
To index packages published by the selected build configurations only, add the NuGet packages indexer build feature to these build configurations.
因为它似乎是最直接的。 NuGet packages indexer
功能应用于构建 NuGet 包项目的两个配置。这些工件正在正确构建,如下所示:
例如,如果我将 v3
端点插入 Visual Studio Package Sources
,我只会得到一个身份验证提示,然后是错误 Unable to load the service index for source .../v3/index.json. Response status code does not indicate success: 401 ().
如果我将 v3
端点粘贴到在浏览器中,我得到一个 json
对象,其中包含具有属性 @id
、@type
和 comment
的对象集合。浏览器中的 v1
和 v2
向我显示一个 XML 文件,其中包含一个空的 Packages
集合。
我如何确认我的包裹实际上最终出现在提要中and/or我是否误解了端点的使用方式?
更新:原来是我的误会。 /v3/index.json 列出了可以对提要执行的操作。使用 /v3/query 列出提要托管的所有包。
剩下的问题是尝试使用提要中的包时出错。 TeamCity 抛出以下错误:
C:\Program Files\dotnet\sdk.1.201\NuGet.targets(124,5): error : Unable to load the service index for source <host>/httpAuth/app/nuget/feed/<project>/<feed_name>/v3/index.json
C:\Program Files\dotnet\sdk.1.201\NuGet.targets(124,5): error : Response status code does not indicate success: 401 ().
我的保管库中的解决方案文件旁边是以下内容NuGet.config
:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nugetserver" value="<host>/httpAuth/app/nuget/feed/<project>/<feed_name>/v3/index.json" />
</packageSources>
</configuration>
是否需要其他东西来连接所有的点?
事实证明,TeamCity 有一个巧妙的小功能,它可以通过将提要放入 Packages sources
输入,轻松地在 NuGet Installer
运行器类型中引用 TeamCity 提要作为构建步骤。通过在 publishes
我的文件之前执行此构建步骤,一切都很好。
我正在设置一些 CI 构建配置,需要一些 NuGet 包。这些 NuGet 包构建在同一台服务器上,这很好。我读到我可以使用 TeamCity 的 NuGet 提要来满足我的要求。我一直在关注 this 指南。
我在 Build
项目上创建了提要,该项目生成了 v1
、v2
和 v3
端点。对于索引包,我选择了第一个选项,即
To index packages published by the selected build configurations only, add the NuGet packages indexer build feature to these build configurations.
因为它似乎是最直接的。 NuGet packages indexer
功能应用于构建 NuGet 包项目的两个配置。这些工件正在正确构建,如下所示:
例如,如果我将 v3
端点插入 Visual Studio Package Sources
,我只会得到一个身份验证提示,然后是错误 Unable to load the service index for source .../v3/index.json. Response status code does not indicate success: 401 ().
如果我将 v3
端点粘贴到在浏览器中,我得到一个 json
对象,其中包含具有属性 @id
、@type
和 comment
的对象集合。浏览器中的 v1
和 v2
向我显示一个 XML 文件,其中包含一个空的 Packages
集合。
我如何确认我的包裹实际上最终出现在提要中and/or我是否误解了端点的使用方式?
更新:原来是我的误会。 /v3/index.json 列出了可以对提要执行的操作。使用 /v3/query 列出提要托管的所有包。
剩下的问题是尝试使用提要中的包时出错。 TeamCity 抛出以下错误:
C:\Program Files\dotnet\sdk.1.201\NuGet.targets(124,5): error : Unable to load the service index for source <host>/httpAuth/app/nuget/feed/<project>/<feed_name>/v3/index.json
C:\Program Files\dotnet\sdk.1.201\NuGet.targets(124,5): error : Response status code does not indicate success: 401 ().
我的保管库中的解决方案文件旁边是以下内容NuGet.config
:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nugetserver" value="<host>/httpAuth/app/nuget/feed/<project>/<feed_name>/v3/index.json" />
</packageSources>
</configuration>
是否需要其他东西来连接所有的点?
事实证明,TeamCity 有一个巧妙的小功能,它可以通过将提要放入 Packages sources
输入,轻松地在 NuGet Installer
运行器类型中引用 TeamCity 提要作为构建步骤。通过在 publishes
我的文件之前执行此构建步骤,一切都很好。