SSH endpoint Octopus system variable not coming through

In one of our PostDeploy.sh scripts, we are not able to get the environment name to come through correctly:

environment=$(get_octopusvariable “Octopus.Environment.Name”)

We are getting an empty value. Ideas?

Hi Michael,
I have just tested your exact script and it seems to print out the environment fine (see attached screenshots).
Could you please double check that you are using the variable in the bash script correctly as $environment.
Could you also let me know of what version Octopus Deploy server you are running along with the details for that target’s health check.
Looking forward to sorting this one out,
Cheers,
Rob

Screenshot1.png

We got it. There was an inlined ${environment,} that wouldn’t evaluate correctly, so we had to split that out into another variable before passing it through correctly.

Hi Michael,
Glad to hear you managed to sort this one out.
Enjoy 3.0
Cheers,
Rob