How do I set the version of a set of packages at deploy time?


I have a website I am getting ready to deploy with Octopus. The website consists of an ASP.NET website, plus a set of generated JavaScript and CSS files that currently live under the website root. The building and packaging occurs on TeamCity. At deploy time, the JavaScript and CSS need to be copied to a CDN (which is referenced via rewrite rules in IIS).

My current design is to build two packages from the TeamCity build, one for the website, and one for the JavaScript/CSS. This way they share versions, and so we can identify exactly what CDN package goes with what website package. At deploy time, the two packages get copied to their respective locations (IIS or CDN).

The problem that I have is that I want to peg the version of the website and the CDN to the same version. So when someone goes to create a release, they pick the version of the website package, and the CDN package will have the same version. Otherwise we could get into a situation where a release contains an incompatible version of the website/CDN content. Is this possible?


Hi Erick,

Thanks for the question.

We don’t currently have a mechanism to enforce package version selection. I have a couple ideas on how you could protect yourself from mistakes or devise a way to choose the same package versions.

You could add a script step that compares the package versions for your NuGet steps and fails the deployment if they don’t match. I think this would be an easy win to make sure you always have compatible versions on your website and CDN.

You could have an external mechanism for creating releases that passes the package versions to Octopus. octo.exe create-release already does this, maybe wrapping octo.exe with a prompt for a version number might be a more convenient way to create releases given the version requirements?

Hope this helps.


Thanks Shane. I’m going to play with that approach. I’ll let you know how it works out.