Different Jenkins $PATH

0 votes

I’m using Jenkins from user Jenkins and has path $PATH set to something. But when I go to Jenkins web interface in system properties, I see a different $path.

I have installed Jenkins on Centos with the native rpm from Jenkins website. 

An someone explain why is this happening?

Aug 13, 2018 in Jenkins by Hannah
• 14,070 points
584 views

2 answers to this question.

0 votes
Changes you make to $path in bash wont be affected in shell, hence it will show a different $path.

Also, any changes you make 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
answered Aug 13, 2018 by Kalgi
• 40,460 points
0 votes

just add:

source /etc/profile

As the first step in my build process.

I assume you're running a shell command as part of your build. Put source /etc/profile as the first command in that Build > Execute Shell > Command textarea

answered Aug 13, 2018 by lina
• 8,110 points

Related Questions In Jenkins

0 votes
2 answers

How to start Jenkins on a different port rather than 8080?

In case you want to change the ...READ MORE

answered Jul 31 in Jenkins by Sirajul
• 25,700 points
1,473 views
0 votes
1 answer

How can I exchange jobs between 2 different Jenkins instances?

java -jar jenkins-cli.jar -s http://server get-job myjob ...READ MORE

answered Jul 6, 2018 in Jenkins by Sophie may
• 9,530 points
47 views
+1 vote
2 answers

What possible return values are there in Jenkins plugin “Sonarqube scanner”

Use Webhooks in SonarQube Administration setup to ...READ MORE

answered Aug 3, 2018 in Jenkins by Nilesh
• 6,880 points
1,612 views
0 votes
1 answer

How can I create global macros and templates in jenkins job builder?

you can append the path to the ...READ MORE

answered Apr 2, 2018 in Jenkins by ajs3033
• 7,280 points
310 views
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
152 views
0 votes
1 answer
+5 votes
5 answers

Jenkins properties file

Follow these steps: 1. Install ‘EnvInject’ plug-in in the Jenkins ...READ MORE

answered Aug 2, 2018 in Jenkins by lina
• 8,110 points
7,611 views
0 votes
2 answers

will running multiple Jenkins masters on same host increase the performance?

While using one big master, u can ...READ MORE

answered Aug 7, 2018 in Jenkins by Kalgi
• 40,460 points
547 views