Octopus system variables with variable substitution

Hello,

Is it possible to reference an Octopus system variable for variable substitution in the Octopus deploy site? I looked at the docs and it just says usable from powershell scripts but I noticed in other parts of the site I can reference them but they have that nifty lookup icon, whereas on a variable page that lookup icon doesn’t exist. For example, I’m on the variables tab of my project in our Octopus Deploy site and attempt to add a variable called SomeFile with value #{Octopus.Action[Deploy Package].Output.Package.InstallationDirectoryPath}\SomeFile.txt. I’ve tried a few different ways and so far this hasn’t worked so I was just curious if this is even possible.

Thanks,
Tom

Hi Tom,

Thanks for getting in touch! It is possible. However when you install a package, you could install it on any number of different machines, so you will need the machine name after output.
Such as: #{Octopus.Action[Deploy Package].Output[Machine Name].Package.InstallationDirectoryPath}
There is some more information about how these system variables are created and used: http://octopusdeploy.com/blog/fun-with-output-variables

Another way to trouble shoot issues with variables is to add two variables to your project OctopusPrintVariables and OctopusPrintEvaluatedVariables and set them to True.
Then run a new release/deployment and look at the Raw logs, it shows you all the variables and when they are available.

Hope that helps!
Vanessa

That helped and I was able to get it working - thanks so much.

Tom