我正在使用 Visual Studio Online - Package Manager Preview 以及新的构建系统。包管理器预览添加了许多构建步骤,包括“NuGet Publisher”步骤,该步骤应将包推送到 Visual Studio Online 托管的私有(private)源。
现在documentation is a little out of step here .和 documentation on auth 一样和 personal access tokens .有一些迹象表明,只要您设置了权限(构建服务帐户对服务端点和包管理器扩展具有权限),就不需要在 VSO 和包管理器之间进行身份验证。实际的构建步骤要求您从服务端点列表中进行选择,这就是我所尝试的。
当我在服务端点上没有放置凭据时,我收到错误:
Server Key must be set, set the password on the generic service
当我尝试将 API key 放在服务端点上时,它似乎在保存时被丢弃......并且错误更改为:
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
我也尝试使用个人访问 token 无济于事。
如何使发布步骤正常工作?
最佳答案
内置 NuGet 发布任务有两个选项:“外部”源和“内部”源。外部源适用于 NuGet.org、Artifactory 等 3rd 方服务,并期望与 API key 建立服务连接。
内部订阅源是由 Team Services 托管的订阅源。添加源的 NuGet 终结点的 URL,而不是服务连接。构建系统依赖项目集合构建服务(对于集合范围的构建定义)或项目构建服务(对于“这个项目”范围的构建定义)作为提要的读者或贡献者。所有可用的文档here .
关于azure-devops - VSO NuGet Publisher 构建步骤失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33776694/