My take on setting up Jenkins for PHP project on Mac OSX

I've found many good articles on setting up Jenkins for PHP projects. But couldn't get one which is targeted to Mac OSX. Here is the one, I followed to setup Jenkins for myself. I took following steps to setup one on Mac OS:

1- Installing php5 and pear using mac-ports: sudo port install php5 +pear
Enable module in apache configuration file: /etc/apache2/httpd.conf

2- Installing/configuring xdebug using macports:
command: sudo ports install php5-xdebug
Macports automatically put in /opt/local/lib/php/extensions/no-debug-non-zts-20090626

Copy xdebug config in /etc/php.ini

Check debug installtion:
php -r 'var_dump(extension_loaded("xdebug"));'

3-Install ant using macports
sudo port install apache-ant
Macports installs ant in : /opt/local/bin/ant

4- Follow this tutorial for creating demo project and other steps:

I had trouble in installing phpunit. I had to do install following packages as well in addition to the packages mentioned in above tutorial:
sudo pear install -f Net_URL2-0.3.1
sudo pear install HTTP_Request2-2.0.0RC1
and then
sudo pear install --alldeps phpunit/PHPUnit

5- Jenkins jobs folderis located at: /Users/Shared/Jenkins/Home/jobs/
6- Restart jenkins using : java -jar jenkins-cli.jar -s http://localhost:8080 safe-restart
7- Reloading jenkins configuration: java -jar jenkins-cli.jar -s http://localhost:8080 reload-configuration
8- Checkout php-template job from this tutorial and reload configuration
9- You are Done !
10- Play around the Jenkins :-)

1 comment:

  1. It was very helpfule. I followed the steps and it worked. Saved a lot of time.


Scheduling Repeating Local Notifications using Alarm Manager

Learn about Scheduling Repeating Local Notifications using Alarm Manager in this post .