Jenkins not showing env set in from .bash_profile

梦想的初衷 提交于 2020-08-08 06:05:35

问题


I'm trying to build via Jenkins but the .bash_profile $PATH additions aren't reflected when built remotely via Jenkins but in the terminal of the same user I can see them.


回答1:


Bash sources .bash_profile only for login sessions, which a Jenkins process is not.

Put your PATH changes in .bashrc, instead.

See also the bash manual on startup files.




回答2:


Whenever you add anything to your .bashrc or .bash_profile, you have to source it. So that added variables will be available to the environment. In your case, source ~/.bash_profile will do the trick.




回答3:


The case could be because you launched the slave agent before making changes in Bash_profile. But Jenkins is still holding on to old values. Relaunching the slave agent could fix it as it has fixed the same issue in my case as the env was showing old parameters in profile file.




回答4:


What worked for me was reloading my tomcat server that was running Jenkins.



来源:https://stackoverflow.com/questions/48829102/jenkins-not-showing-env-set-in-from-bash-profile

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!