Iris Classon
Iris Classon - In Love with Code

Outputting all the available Octopus Deploy variables

We recently moved our environments to new virtual machines, and decided to reinstall and set up Octopus Deploy from scratch. We also used this opportunity to change some of the deploy steps so we could benefit from the new features in Octopus Deploy. Octopus Deploy has a long list of variables that simplifies the steps (if used correctly) – and also helps making the steps more generic.
However, they are confusing, and I’m never 100% sure which one I need and the simplest way to sort this out is by printing out all of them (key and value) in combination with the documentation.

Simply add a script step in your release, preferably as a part of a step where you need the variables. Iterate through the variables using PowerShell, printing key and value and once run the output will be visible in the release log result.

A loooong list of variables. I copied the list and saved it in my OneNote, with some notes about the state of the release and NuGet package that was released so I have some context.

 
foreach ($key in $OctopusParameters.Keys){
$value = $OctopusParameters[$key]
echo "$key $value"
}

Comments

Leave a comment below, or by email.


Last modified on 2017-07-04

comments powered by Disqus