Create different custom installation directory for each phase within a project


I have a project implementing a lifecycle that consists of three phases (QA, UAT, and PROD). Sometimes each phase has a different file path for the package to be deployed too (sometimes QA and UAT are on the same machine, but uses different file paths for the installation). However, I do not see any place where I can specify the file path based on the phase the current package is being deployed too.

Right now, I have a single step in the project. The step uses the “custom install directory” feature and I reference a variable here. I have a total of three variables setup for the project (one for each phase of the lifecycle). I can try setting up multiple steps in the project and using each variable in each step, but when the release is deployed to UAT, then it will run the first step which uses the QA file path, and then correctly run the second step which installs in the UAT directory, and then incorrectly run the third step which installs the release to the PROD directory (if all three phases uses the same machine).

How can I specify a directory per phase in the lifecycle?

Please help!


Hi Edward,

Thanks for getting in touch! I’m sorry for the delay in getting back to you here. It looks like you need to use our Variable Scoping feature to tell Octopus when to use these variables.

If you create a single variable called CustomInstallDirectory and provide it with three different values like below. You can assign each value a Scope. During deployment Octopus will pick the value based on the scoping. So you can assign each value a scope of the environment relative to where you need it.


VariableName VariableValue Scope
CustomInstallDirectory C:\Folder\QA\ QA
CustomInstallDirectory C:\Folder\UAT UAT
CustomInstallDirectory C:\Folder\PROD PROD

Scoped variables are used all throughout Octopus and are the primary method of making your deployment as dynamic and light weight as possible.

If you have any questions here, please don’t hesitate to let me know. :slight_smile:

Best regards,

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.