Env variables can't use in material git branch. #12594
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
No, and this is by design. Materials in GoCD are independent of pipelines, and environment variables are a process-runner/OS-level construct that are only known at run time. Not all materials in GoCD assume use of a separate OS-level process call, so dynamic environment variables don't make sense there either. In practice you can use environment variables only in tasks; when they are run on agents. You might be able to use pipeline parameters instead if you are using pipeline templates (with multiple pipelines for different branches), but whether that makes sense depends on what you are trying to achieve. |
Beta Was this translation helpful? Give feedback.
No, and this is by design. Materials in GoCD are independent of pipelines, and environment variables are a process-runner/OS-level construct that are only known at run time. Not all materials in GoCD assume use of a separate OS-level process call, so dynamic environment variables don't make sense there either.
In practice you can use environment variables only in tasks; when they are run on agents.
You might be able to use pipeline parameters instead if you are using pipeline templates (with multiple pipelines for different branches), but whether that makes sense depends on what you are trying to achieve.