Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use homebrew packages in Jenkins in MacOSX

How do I enable, somehow, my Jenkins instance (installed via homebrew) to use the packages that I've installed via homebrew. For example I can't call git from a SH job in Jenkins because I'v installed Git ia homebrew and due that this package (Git) is not available to the Jenkins user.

Below I'm trying to call brew for test and I'm getting a error:

Started by user anonymous
Building in workspace /var/root/.jenkins/workspace/sandbox
[sandbox] $ /bin/sh -xe /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/jenkins2268498674034232648.sh
+ brew
/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/jenkins2268498674034232648.sh: line 2: brew: command not found
Build step 'Execute shell' marked build as failure
Finished: FAILURE

Should I had install homebrew for all users?

like image 657
Idemax Avatar asked Oct 19 '25 01:10

Idemax


1 Answers

Just add /usr/local/bin to the environment variable PATH.

There is many ways to accomplish this. You can configure it in the global properties (Manage Jenkins -> Configure System -> Global Properties) or use plugin such as EnvInject or even simply set it in the beginning of the script block, e.g.

PATH=$PATH:/usr/local/bin
like image 189
jil Avatar answered Oct 21 '25 15:10

jil