我正在使用 Visual Studio Online - 包管理器预览版以及新的构建系统。包管理器预览添加了许多构建步骤,包括“NuGet Publisher”步骤,该步骤应将包推送到 Visual Studio Online 托管的私有源。
Now the 这里的文档有点不合拍。正如有关授权的文档 and 个人访问令牌。有一些迹象表明,只要您设置了权限(构建服务帐户具有对服务端点和包管理器扩展的权限),您就不需要在 VSO 和包管理器之间进行身份验证。实际的构建步骤要求您从服务端点列表中进行选择,这就是我所尝试的。
当我在服务端点上未放置任何凭据时,我收到错误:
Server Key must be set, set the password on the generic service
当我尝试将 API 密钥放置在服务端点上时,它似乎在保存时被丢弃...并且错误更改为:
2015-11-18T08:35:24.5678951Z Invoking nuget with push C:\a\1\s\EventViewer\bin\Release\Project.Name.1.1.12.0.nupkg -s https://example.pkgs.visualstudio.com/DefaultCollection/_packaging/example/nuget/v3/index.json usfusmx4ez6mlfqwpp2abzc7e37denfcp7bxsep2hqij3tp4qwvq on C:\a\1\s\EventViewer\bin\Release\Project.Name.1.1.12.0.nupkg
2015-11-18T08:35:24.5688946Z C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default\agent\worker\tools\NuGet.exe push C:\a\1\s\EventViewer\bin\Release\Project.Name.1.1.12.0.nupkg -s https://example.pkgs.visualstudio.com/DefaultCollection/_packaging/Example/nuget/v3/index.json usfusmx4ez6mlfqwpp2abzc7e37denfcp7bxsep2hqij3tp4qwvq
2015-11-18T08:35:25.3467312Z Please provide credentials for: https://example.pkgs.visualstudio.com/DefaultCollection/_packaging/Example/nuget/v3/index.json
2015-11-18T08:35:25.3667189Z ##[error]Object reference not set to an instance of an object.
2015-11-18T08:35:25.3677179Z UserName: Password:
2015-11-18T08:35:25.4647059Z ##[error]Unexpected exit code 1 returned from tool NuGet.exe
我还尝试使用个人访问令牌但无济于事。
如何让发布步骤正常工作?
内置 NuGet 发布任务有两个选项:“外部”源和“内部”源。外部源适用于 NuGet.org、Artifactory 等第三方服务,并期望使用 API 密钥进行服务连接。
内部源是由 Team Services 托管的源。您可以添加源的 NuGet 端点的 URL,而不是服务连接。构建系统依赖于项目集合构建服务(对于集合范围的构建定义)或项目构建服务(对于“此项目”范围的构建定义)作为提要的读者或贡献者。所有可用的文档here.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)