6

我目前正在从 TFS 2012 迁移到 Azure DevOps 2019(都在本地)。对于旧服务器,我会从我们的一些构建中手动创建 NuGet 包,并将这些.nupkg文件托管在文件共享上(在 Visual Studio 中配置为包源)。使用 DevOps,我显然可以自动化所有这些并将包直接推送到工件提要中。

旧服务器需要退役,因此我想将现有的 .nupkg 文件从文件共享中移出到新的工件提要中。这可能吗?

4

1 回答 1

4

是的,您可以将现有.npukg文件推送到新提要。

您可以创建一个简单的 PowerShell 脚本,将您的所有.nupkg文件推送到提要:

# 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
})
于 2019-09-05T09:05:02.123 回答