We use Octopus Deploy 3.2.16 to deploy a NuGet package to an Azure Cloud Service.
From our Deploy.ps1 file, we need to identify the newest NuGet package published in this feed.
For example, we have this scenario:
Day 1: we deploy v1.0.0
Day 2: we deploy v.1.0.1
Day 3: we re-deploy v1.0.0
When re-deploying v1.0.0 on Day3, the Deploy.ps1 Powershell script that gets executed during deployment needs to identify the highest-version NuGet package in the current feed (I.E. “v1.0.1”), then retrieve and use a certain file form this package (I.E. “Library.dll”)
Thanks for reaching out. There’s really no pretty way of doing this. Octopus works under the best practice of having a single artifact/package that contains all the elements your app needs to work. Downloading another package just to get 1 file of it is not something we encourage people to do.
The only way I can think to do this would be to:
A) Download the package using nuget.exe from your Nuget server. This won’t be possible if you are using Octopus’ built-in feed in which case you’ll need to add a 2nd step to deploy 1.0.1 first so it is available when you deploy 1.0.0.
B) If the package is already on the server and you deploy every package to a different directory, fetch the file from v1.0.1's path.