hg not found in Jenkins

This is an interesting one. Let’s get cracking – El capitan 10.11, Jenkins 2.19

  1. Go to http://localhost:8080/systemInfo and see the value for PATH. Most probably it is /usr/bin and not /usr/local/bin
  2. Check ‘which hg’ in terminal and this will point to /usr/local/bin
  3. So, this means Jenkins should now have the path /usr/local/bin and not /usr/bin since hg  is installed in /usr/local/bin in mac. In my case I am running El Capitan 10.11.6 and this does not allow symlink to /usr/bin
  4. sudo vi /Library/LaunchDaemons/org.jenkins-ci.plist 

  5.  Under the EnvironmentVariables key you will see a <dict>
  6. Add

    <key>PATH</key><string>/usr/local/bin:/usr/bin</string>

  7. Stop Jenkins
    1. sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist

  8. Start Jenkins
    1. sudo launchctl load /Library/LaunchDaemons/org.jenkins-ci.plist

  9. Go to http://localhost:8080/systemInfo and you should not see the updated path
  10. And hopefully, hg works this time. Enjoy!
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s