在詹金斯大师中修改PATH变量 [英] modify PATH variable in jenkins master

查看:177
本文介绍了在詹金斯大师中修改PATH变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在jenkins主节点(我没有从节点)中修改PATH.从全局属性->环境变量"中,我添加2个条目:"PATH",其值为"$ PATH:/opt/foo"和"FOO",其值为"BAR".现在,当我运行我的自由样式作业时,执行外壳构建步骤为"echo $ PATH;". echo $ FOO我看到PATH未被修改,因此FOO可以正确显示. 这是为什么? 有什么办法可以从jenkins全局配置中修改PATH? 我设法通过EnvInject插件在作业级别上修改了PATH,但我真正想要的是为所有作业修改PATH.

I am trying to modify PATH in jenkins master node (i have no slaves).From "Global Properties -> Environment Variables" i add 2 entries: "PATH" with value "$PATH:/opt/foo" and "FOO" with value "BAR". Now when i run my free style job with execute shell build step being "echo $PATH; echo $FOO" i see that PATH was not modified whereby FOO is displayed correctly. Why is that? Is there any way to modify PATH from jenkins global configuration ? I managed to modify PATH on a job level via EnvInject plugin but what i am really looking for is to modify PATH for all jobs.

推荐答案

您做对了.相同的Manage Jenkins =>全局属性=>环境变量对我有用.

You are doing it right. The same Manage Jenkins => Global Properties => Environment variables works for me.

请注意,如果您安装了EnvInject插件,它似乎会掩盖Jenkins全局配置中的环境变量.因此,请卸载EnvInject并重试.

Please note that if you have the EnvInject plugin installed, it seems to mask the environment variables from Jenkins global configuration. So uninstall EnvInject and try again.

这篇关于在詹金斯大师中修改PATH变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆