0
votes

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 we 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 from this package (I.E. "Library.dll")

Any suggestion on how can this be done?

1

1 Answers

1
votes

I recommend handling this at the packaging level so the deployment of v1.0.0 with a different version of Library.dll is treated as a completely new release.

A critical part of deployment automation is knowing what is being deployed and dynamically chaning the dependencies will make your deployments highly volatile as the same version will not contain the same artefacts.

In most cases the adjusted package of v1.0.0 with the updated dependency would need to be tracked through the deployment pipeline just like any other release, whereas if you dynamically changed the artefacts, it could surprisingly have a different dependency on an environment just because a new version is flowing behind it.