git not found with jenkins + composer (php)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

git not found with jenkins + composer (php)

chriss
This post has NOT been accepted by the mailing list yet.
Here's my problem. I have a build file: http://pastebin.com/mhs76S8p

When I run this from my console on my os x box I get BUILD SUCCESSFUL.
bash-3.2$ ant -f build.xml
Buildfile: /Users/Shared/Jenkins/Home/jobs/testproject/build.xml

clean:
   [delete] Deleting: /Users/Shared/Jenkins/Home/jobs/testproject/composer.phar

composer:
     [exec]   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
     [exec]                                  Dload  Upload   Total   Spent    Left  Speed
     [exec]
     [exec]   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0 17  679k   17  116k    0     0   502k      0  0:00:01 --:--:--  0:00:01  686k
     [exec] 100  679k  100  679k    0     0  1303k      0 --:--:-- --:--:-- --:--:-- 1478k
     [exec] Loading composer repositories with package information
     [exec] Installing dependencies from lock file
     [exec] Nothing to install or update
     [exec] Generating autoload files

BUILD SUCCESSFUL




However, when I run this same build file from jenkins I get:
clean:
   [delete] Deleting: /Users/Shared/Jenkins/Home/jobs/testproject/composer.phar

composer:
     [exec]   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
     [exec]                                  Dload  Upload   Total   Spent    Left  Speed
     [exec]
     [exec]   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0100  679k  100  679k    0     0  1285k      0 --:--:-- --:--:-- --:--:-- 1348k
     [exec] Loading composer repositories with package information
     [exec] Installing dependencies
     [exec]   - Installing patchwork/utf8 (dev-master v1.0.4)
     [exec]     Cloning v1.0.4
     [exec]
     [exec]
     [exec]                                                                                                                                            
     [exec]   [RuntimeException]                                                                                                                        
     [exec]   Failed to clone http://github.com/nicolas-grekas/Patchwork-UTF8.git, git was not found, check that it is installed and in your PATH env.  
     [exec]                                                                                                                                            
     [exec]   sh: git: command not found                                                                                                                
     [exec]                                                                                                                                            
     [exec]                                                                                                                                            
     [exec]
     [exec]
     [exec] install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|--verbose] [-o|--optimize-autoloader]
     [exec]
     [exec]




Both jenkins and my console were using the same user "jenkins".

bash-3.2$ whoami
jenkins
bash-3.2$ git
usage: git [--version] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]


Any ideas why this is failing? Very frustrating..

Thanks in advance!
Chris
Reply | Threaded
Open this post in threaded view
|

Re: git not found with jenkins + composer (php)

chriss
Found a solution thanks to #jenkins-php on freenode.

http://localhost:8080/configure -> Global configuration -> Environment variables
name = PATH
value = /usr/local/git/bin:$PATH