Based on alex88' Symfony 2.1. template: https://github.com/alex88/symfony2.1-jenkins-template and sebastianbergmann' PHP-jenkins-template https://github.com/sebastianbergmann/PHP-jenkins-template .
First, follow the instructions from http://jenkins-php.org/ for installing Jenkins.
On Ubuntu, you can install with
apt-get install jenkins
Remember to intall PEAR phpunit and phpDox. Obviously, install configure PHP to run Symfony checking app/check.php.
Process to install the template:
-
Download and install the job template
cd $JENKINS_HOME/jobs
mkdir php-template
cd php-template
wget https://raw.github.com/xmontana/Jenkins-Symfony2.1/master/php-jenkins-template/config.xml
cd ..
chown -R jenkins:jenkins php-template/ -
Reload Jenkins' configuration.
-
Click on "New Job".
-
Enter a "Job name".
-
Select "Copy existing job" and enter "php-template" into the "Copy from" field.
-
Click "OK".
-
Disable the "Disable Build" option.
-
Fill in your "Source Code Management" information.
-
Configure a "Build Trigger", for instance "Poll SCM".
-
Click "Save".
If you have any problems, please check http://jenkins-php.org/
-
Clone this repository: git clone https://github.com/xmontana/Jenkins-Symfony2.1.git
-
Move the "jenkins" folder insde folder "jenking-symfony2.1" to
[SYMFONY2_ROOT]/app/Resources/
inside your Symfony2 project. -
Move
build.xml
to the root folder of your Symfony2 application. -
Move
phpunit.xml
to[SYMFONY2_ROOT]/app
folder or update the existing one. Thelogging
node is needed! -
Add th symfony2-coding-standards in your phpcs naming it as
Symfony2
or edit the phpcs target on build.xml with the right parameters for your envirement.
You can customize the configuration as you want, this works fine with me :)
Note: This template is for Symfony2.1 with composer.
Note2: The build procedure will copy parameters.yml.dist to parameters.yml remember that you don't commit this file for best practices.