Nuget.exe 推送 **\*.nupkg 和 Azure DevOps 工件
Nuget.exe push **\*.nupkg & Azure DevOps Artifacts
我目前正在将我的组织从本地 nuget (v2) 迁移到 Azure DevOps Artifacts。 (Cloud) 我们有几十个不同版本的包,我想把它们放到 AzDo Artifacts 中。看起来我可以使用 powershell 并使用 \MyFileSharePath***.nupkg 作为路径,它应该抓住它们并推送每个包的每个单独版本。
这是可行的方法吗?
我应该研究更好的方法吗?
这个问题看起来很相似,但涉及所有预置资源。不确定这是否重要。:
这是有效的方法,在 the documentation
中推荐
For each share, push all packages in the share to the new feed: nuget push {your package path}*.nupkg -Source {your NuGet package source URL} -ApiKey Azure DevOps Services
关于将当前供稿设置为只读,您也有很好的提示
For larger teams, you should consider marking each share as read-only before doing the nuget push operation to ensure no one adds or updates packages during your migration.
因此我认为没有更好的方法了。
我最后使用的命令是:
.\nuget.exe push [LocalPackageStorage]\**\*.nupkg -source [Our Azure DevOps Artifacts Feed] -apikey [Any Non null string] -timeout 1200
请注意,这会递归地遍历整个结构并在其中获取每个包的每个版本。它 运行 很顺利,但我第一次 运行 它过早地失败了,因为推送的默认超时是 300 秒。发生这种情况时,我最终关闭了提要,因为我在一个未开发的场景中工作,最快的方法是将其清除并重新开始,而不是弄清楚哪些已经上传或没有上传。如果您不在类似的未开发场景中工作,请务必小心,因为这可能会导致很多非常烦人的工作来整理已完成和未完成的内容。
我目前正在将我的组织从本地 nuget (v2) 迁移到 Azure DevOps Artifacts。 (Cloud) 我们有几十个不同版本的包,我想把它们放到 AzDo Artifacts 中。看起来我可以使用 powershell 并使用 \MyFileSharePath***.nupkg 作为路径,它应该抓住它们并推送每个包的每个单独版本。
这是可行的方法吗? 我应该研究更好的方法吗?
这个问题看起来很相似,但涉及所有预置资源。不确定这是否重要。:
这是有效的方法,在 the documentation
中推荐For each share, push all packages in the share to the new feed: nuget push {your package path}*.nupkg -Source {your NuGet package source URL} -ApiKey Azure DevOps Services
关于将当前供稿设置为只读,您也有很好的提示
For larger teams, you should consider marking each share as read-only before doing the nuget push operation to ensure no one adds or updates packages during your migration.
因此我认为没有更好的方法了。
我最后使用的命令是:
.\nuget.exe push [LocalPackageStorage]\**\*.nupkg -source [Our Azure DevOps Artifacts Feed] -apikey [Any Non null string] -timeout 1200
请注意,这会递归地遍历整个结构并在其中获取每个包的每个版本。它 运行 很顺利,但我第一次 运行 它过早地失败了,因为推送的默认超时是 300 秒。发生这种情况时,我最终关闭了提要,因为我在一个未开发的场景中工作,最快的方法是将其清除并重新开始,而不是弄清楚哪些已经上传或没有上传。如果您不在类似的未开发场景中工作,请务必小心,因为这可能会导致很多非常烦人的工作来整理已完成和未完成的内容。