2
votes

I have a web server and an app server, which are set up as two separate roles which I can deploy to in Octopus Deploy, named "My-Web-Sever" and "My-App-Server" repesctively.

I have a variable which is a file share path on my app server. This is an app setting in the web config in my web project, and I want to transform this setting as part of the deployment.

The machine name of the app server will be different depending on the environment that I am deploying to, therefore I want to pass the machine name into the variable by referencing the app server role name, something like:

\\$OctopusParameters["My-App-Sever.Machine.Name"]\MyShareName

Is this possible? Otherwise I will have to create a variable for each environment with the machine name explicitly set.

1

1 Answers

2
votes

You can define Octopus Variables that reuse Octopus variables, i.e. Name = MyVariable, Value = Something#{OctopusMachineName}. This was introduced in 1.2.2. The only other way round this (to avoid defining a variable per environment) is by mapping drives to the network shares - then the share names become constant across all environments.