Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
636 views
in Technique[技术] by (71.8m points)

modify PATH variable in jenkins master

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...