Can I upload existing NuGet packages to an Azure DevOps artifacts feed?

▼魔方 西西 提交于 2021-02-07 03:24:35

问题


I'm currently migrating from TFS 2012 to Azure DevOps 2019 (both on-premise). With the old server, I would manually create NuGet packages from some of our builds, and host these .nupkg files on a file share (configured as a package source in Visual Studio). With DevOps, I can obviously automate all of this and push the packages straight into an artifact feed.

The old server needs to be decommissioned, so I would like to move the existing .nupkg files out of the file share into the new artifacts feed. Is this possible?


回答1:


Yes, you can push existing .npukg files to the new feed.

You can create a simple PowerShell script that pushes to the feed all your .nupkg files:

# If you didn't add the new feed to your NuGet sources so add it:
nuget sources Add -Name "NEW-FEED" -Source "https://pkgs.dev.azure.com/org/_packaging/NEW-FEED/nuget/v3/index.json"
# Put all the nugets in one folder and move to this folder
cd path/to/nupkg/folder
$files = dir
$files.ForEach({
  push -Source "NEW-FEED" -ApiKey AzureDevOps $_.Name
})


来源:https://stackoverflow.com/questions/57801671/can-i-upload-existing-nuget-packages-to-an-azure-devops-artifacts-feed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!