I'd like to set an environment variable dynamically based on the hostname of the agent running the configuration
##teamcity[setParameter name='env.target_host' value='$target_host']
When I try to display the value in another build step to verify that it worked, the value is blank in both instances
echo "=== target_host is $target_host ==="
echo "=== target_host is %env.target_host% ==="
Also, I have defined in the build parameters an empty env.target_host parameter (in case an existing parameter was needed to be overridden by the build script interaction)
Is what I am trying to do possible? How can I make it work?