Push multiple packages to private nuget (VSTS) wit

2019-05-06 18:35发布

I'm trying to push multiple nuget packages at ONCE to private VSTS nuget server.

I searched doco but could not find a batch Push command. I'm using the command below which seems to overwrite already existing nuget packages on VSTS.

nuget push mynuget.nupkg -Source https://myvsts.pkgs.visualstudio.com/DefaultCollection/_packaging/SitecorePackages/nuget/v3/index.json -ApiKey VSTS

UPDATE:

I used the push *.nupkg however, I can see only the 8.1.x version pushed.

enter image description here

Thanks.

3条回答
Melony?
2楼-- · 2019-05-06 18:47

Here is a powershell script you can use to bulk push NuGet packages to a VSTS feed. It will ignore any of the .symbols.nuget files:

set-location \\path\to\nugetpackages

$files=get-childitem | where {$_.Name -like "*.nupkg" -and $_.Name -notlike "*symbols*"}

foreach($file in $files) {
  .\NuGet.exe push -Source "MySource" -ApiKey key $file.name
}
查看更多
何必那么认真
3楼-- · 2019-05-06 18:54

It's not possible to overwrite existing packages on VSTS. nuget.exe allows wildcards for push, so you could say nuget push *.nupkg -Source https://myvsts.pkgs.visualstudio.com/DefaultCollection/_packaging/SitecorePackages/nuget/v3/index.json -ApiKey VSTS.

查看更多
啃猪蹄的小仙女
4楼-- · 2019-05-06 19:13

First, I exclude previously uploaded packages from the "packages" folder and it contains only packages that not exists in local server. After that I use below command and it works fine.

nuget.exe push -Source "MyFeedName" -ApiKey VSTS packages\**\*.nupkg
查看更多
登录 后发表回答