jenkins on Mac, PATH is not set right, no /usr/local/bin

前端 未结 5 1227
不思量自难忘°
不思量自难忘° 2020-12-14 15:00

I recently installed Jenkins, using Homebrew. I also installed Mercurial using Homebrew.

I can successfully clone an hg repo just fine - from Terminal. But if I try

5条回答
  •  半阙折子戏
    2020-12-14 15:14

    I found that even setting the PATH environment variable for the node didn't work for the hombrew Mercurial installation. The path WOULD get set, but only for the script build phase, not for the VCS checkout phase. Here's what I wound up doing.

    1. Go into Manage Jenkins -> Configure System
    2. Add a new Mercurial Installation
    3. Name it whatever you want (I named mine build-mac)
    4. For Installation Directory I put /usr/local
    5. The Executable parameter was pre-set to INSTALLATION/bin/hg, so I just left it at that.
    6. Everything else in here can be left blank
    7. Go into your job and edit the configuration
    8. Under Source Code Management set Mercurial Version to the mercurial installation you just added.
    9. Save
    10. $$$

    Hope that helps anyone else running into this same problem, now that we're not allowed (by default anyways) to do anything inside of /usr/bin anymore. Previously I would have just symlinked hg there, but now with the new "System Integrity Protection" "feature", that's no longer as trivial of task, and even more difficult if your Mac slave is headless.

提交回复
热议问题