gocd-yaml-config-plugin
gocd-yaml-config-plugin copied to clipboard
Cannot refer elastic_profile_id to an environment variable.
Hi,
I'm trying to keep the elastic agent profile name in GoCD's environment.
Then, each config repository will have dedicated environment for its.
I tried to refer the elastic_profile_id with an environment variable but it's not working.
For example, elastic_profile_id: ${env:AGENT_NAME}.
How can I refer the environment variable for the property? or Is it limitation?
An environment variable in GoCD is only created and is available at runtime (provided to a task), and not at configuration time. So, that won't be possible. At the time this configuration is parsed and the pipeline created, there is no agent.
Thanks @arvindsv. I already requested a feature proposal https://github.com/gocd/gocd/issues/10864.