Can you tell Octopus that a package depends on a specific version of another package?

We have two packages in a deployment project: PackageSmall and PackageBig. They are used in two different steps in the process. PackageBig changes rarely, say once a month. PackageSmall changes constantly. When we deploy, we deploy PackageSmall and the specific version of PackageBig that version of PackageSmall works with. We do this by specifying the specific PackageBig version in the Channel.

The problem comes when PackageSmall is changed to work with a new version of PackageBig. We forget to update the deployment process and things are mysteriously broken for a while until someone remembers to change the PackageBig version in the Channel.

One option would be to include all the PackageBig files in PackageSmall, but this is not ideal as it’s a lot of files and, again, it changes rarely.

Is there a way to specify that an Octopus package depends on a specific version of another package? it would be great if we could say
version 5.4.1 of PackageSmall ties to version 8.7.1 of PackageBig
version 5.4.2 of PackageSmall ties to version 9.0.0 of PackageBig

The other option I’ve considered is to run a PowerShell script to verify that the correct version of PackageBig is being deployed for the given version of PackageSmall and, if not, fail the deployment.

Hi Matthew,

Thanks for reaching out. I dedicated a whole cup of coffee to think about a way to implement this, but I couldn’t find a better option than the ones you mentioned.

The Powershell step at the beginning of the process shouldn’t be too hard to write. You can reference the versions of the packages that will be used later in the deployment using the variables

$OctopusParameters['Octopus.Action[DEPLOY STEP 1].Package.NuGetPackageVersion']

$OctopusParameters['Octopus.Action[DEPLOY STEP 2].Package.NuGetPackageVersion']

“Deploy step1” and “Deploy step 2” would be the names of my 2 package deploy steps

Hope that helps,
Dalmiro