Global Variables

Is is possible to have the same variable defined at Machine / Environment Level, that can be used by multiple projects.

This would be good as we can define global logging and repository file paths

I agree, it would be really helpful if we could define a variable globally across all projects.


Thanks for the suggestion. It’s currently not possible to do this.

One question from an implementation point of view is how we handle changes to global variables.

When a release is created, we “snapshot” the project variables. For example:

  1. You packaged a web app with a web.config containing an appsetting named “Foo”. You used this in release 1.0. You have a variable in Octopus with the same setting name.
  1. You renamed the appsetting to “bar” and create a new release, 1.1. You also updated the Octopus variables.

So far it’s all good. But then you decide to deploy release 1.0 again to an old environment, maybe for regression testing. If we didn’t take a snapshot of the variables, the 1.0 release would expect a setting named “Foo” but we only have a variable for “bar”. That’s why we take snapshots.

The question for global variables is, will they be included in the release snapshot?


I would say no.

Example A: We have a destination, be it file or registry, where we can store machine-wide configuration. We certainly want to use the 1.0 version of this setting when deploying 1.0 release to an environment.
Solution: That setting is included as a part of the default project output and is not governed by Octopus.

Example B: We have a git server where the configuration files are retrieved from at deploy. At some point in time the project path or server hostname changes. When deploying 1.0 release we have to use the new project path.
Solution. Octopus Global Variable, not included in the release snapshot.

Hi Oskar (and those still watching this thread!),

I have created a UserVoice for this suggestion.
Please go and comment and vote and see if we can get this feature built!


I noticed I am the only voter. To other subscribers on this post: Please go to the above address and vote :slight_smile: