gocd-yaml-config-plugin icon indicating copy to clipboard operation
gocd-yaml-config-plugin copied to clipboard

Cannot refer elastic_profile_id to an environment variable.

Open worapojc opened this issue 3 years ago • 2 comments

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?

worapojc avatar Sep 29 '22 05:09 worapojc

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.

arvindsv avatar Sep 29 '22 09:09 arvindsv

Thanks @arvindsv. I already requested a feature proposal https://github.com/gocd/gocd/issues/10864.

worapojc avatar Sep 30 '22 08:09 worapojc