我需要能够从 linux gocd 代理更新环境变量。应该可以从代理上运行的任何管道中访问此环境变量。到目前为止,我阅读的文档讨论了使用在 gocd 环境中创建的环境变量。然而,这不是我的要求。
到目前为止,我已经尝试了以下步骤:
- Logged into the agent as go user and set an environment variable ( export VARA=XXX)
- Tried to echo this variable from a pipeline in gocd that prints this variable, in vain.
- Also tried specifying the variable in bash_profile, bashrc and executed the source command in the same gocd task that echoes the variable
出于某种原因,gocd 管道似乎没有看到这个变量。如果您有任何指示,请告诉我。