Jenkins / Hudson环境变量 [英] Jenkins / Hudson environment variables
问题描述
我从用户 jenkins
运行Jenkins,它有 $ PATH
设置为某种东西,当我进入Jenkins web ( http:// $ host / systemInfo
),我看到一个不同的 $ PATH / code>。
我已经在Jenkins网站上使用本机rpm在Centos上安装了Jenkins。我使用安装提供的启动脚本使用 sudo /etc/init.d/jenkins start
>两件事:
当Jenkins连接到计算机时,它会进入 sh
shell, code> bash shell(至少这是我注意到 - 我可能是错误的)。因此,不会考虑对bashrc文件中的$ PATH所做的任何更改。
此外,如果对本地shell中的$ PATH进行更改
要更改Jenkins使用的路径,您有两个选项(AFAIK):
1)编辑您的 / etc / profile
文件并添加您想要的路径
2)转到您的从站的配置页面,添加环境变量 PATH
,值为: $ PATH:/ followed-如果您使用第二个选项,您的系统信息仍然不会显示它,但您的构建将看到添加路径。
I am running Jenkins from user jenkins
thats has $PATH
set to something and when I go into Jenkins web interface, in the System Properties window (http://$host/systemInfo
) I see a different $PATH
.
I have installed Jenkins on Centos with the native rpm from Jenkins website. I am using the startup script provided with the installation using sudo /etc/init.d/jenkins start
Can anyone please explain to me why that happens?
Michael,
Two things:
When Jenkins connects to a computer, it goes to the sh
shell, and not the bash
shell (at least this is what I have noticed - I may be wrong). So any changes you make to $PATH in your bashrc file are not considered.
Also, if you make changes to $PATH in your local shell (one that you personally ssh into), will not show up in Jenkins.
To change the path that Jenkins uses, you have two options (AFAIK):
1) Edit your /etc/profile
file and add the paths that you want there
2) Go to the configuration page of your slave, and add environment variable PATH
, with value: $PATH:/followed-by/paths/you/want/to/add
If you use the second option, your System Information will still not show it, but your builds will see the added paths.
这篇关于Jenkins / Hudson环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!