RFC: Only calling PowerShell scripts at the root

Published on: 24 Apr 2014

Imagine a package that looks like this:

NuGet package with multiple deployment scripts

During deployment, Octopus Deploy will currently invoke all four Deploy.ps1 scripts during deployment. There's no guaranteed order as to which script gets invoked first. For some people, this causes problems - they might have a Deploy.ps1 script deep in their package that means something different (it's not meant for Octopus).

We're thinking of making some changes here, but I'm not clear on what exactly the best way forward is. I need your help to decide! Keep in mind that one of our goals is to make things "just work" out of the box. The answer is not to add a bunch of checkboxes to make it optional :-)

Option 1: Don't change it

This is the easy option - just call whatever files we find. We could sort based on depth (how 'root-most' the script is), and then alphabetically, to make it slightly more deterministic.

Option 2: Only call the root script

Update: We decided to do this from Octopus 2.4 onwards

If the root Deploy.ps1 script exists, we'll call it, otherwise we'll call nothing. This means that you have to put your scripts at the root of the package (not in a sub-folder) for Octopus to call them.

Option 3: Call the root-most script

Call the script that is closest to the root. If there's no script at the root, then we'll traverse subdirectories and call the first script we find.

What if the package looks like this?

Root most

In this case, should we a) invoke both, b) invoke neither, or c) invoke the first one we find?


Octopus Deploy is used by thousands of developers across the globe, from small companies to large enterprises. Find out if it meets your deployment automation needs by taking advantage of our free 30-day trial. You can spin up an instance with just a few clicks!