I have below variables:
ENVNAME[machine1]=ABC
ENVNAME[machine2]=XYZ
I also have two deployment targets: machine1 and machine2
In my step template, I am trying to use below run condition:
#{if USER_SUPPLIED_MACHINE_NAME == ENVNAME[#{Octopus.Machine.Name}]}True#{/if}
“USER_SUPPLIED_MACHINE_NAME” is a prompted variable populated via user input.
However, this condition always evaluates to false. I have tried setting OctopusPrintVariables and OctopusPrintEvaluatedVariables to True to debug the evaluation of the run condition but that does not add any additional details about run condition in the logs (which is surprising because run condition evaluation is a totally opaque operation from the point of view of details in deployment log and can actually benefit from logging).
I have also tried minor variations e.g.
#{if USER_SUPPLIED_MACHINE_NAME == #{ENVNAME[#{Octopus.Machine.Name}]}}True#{/if}
However, the condition always evaluates to False.
Also, the variables substitutions page does not have any examples for comparing two variables in “if” condition.