Skip to content

Latest commit

 

History

History
80 lines (53 loc) · 1.95 KB

README.md

File metadata and controls

80 lines (53 loc) · 1.95 KB

PHP CI

Introduction

This project build a continuous integration server for php.

This server contains Jenkins and Sonar with some usefull plugins :

Requirements

Installation

Clone the project and add your Vagrantfile.

$ git clone [email protected]:widop/php-ci.git

Add your custom config in the Vagrantfile. See vagrant doc

To create the server execute

$ vagrant up

Wait for the server to be ready.

Now you have to configure jenkins plugins.

Enjoy.

Usage

Build project

Add a shell script

#!/bin/bash

rm -rf .sonar/
cp app/config/parameters.ini.ci app/config/parameters.ini
php bin/vendors install
php app/console doctrine:database:drop --force --env=test
php app/console doctrine:database:create --env=test
php app/console doctrine:schema:update --force --env=test
php app/console widop:fixtures:load --env=test
php app/console cache:clear --env=test
php app/console assetic:dump --env=test

Analyse project

If you want Jenkins to call Sonar at the end of a build you have to add some configuration in your project configuration.

Go to Project > Configure > Sonar and add those propreties.

For example

sonar.projectKey=widop:project
sonar.projectName=Project
sonar.projectVersion=develop
sonar.language=php
sonar.sources=src,src2
sonar.phpUnit.configuration=app/phpunit.xml
# sonar.tests=

If you want to skip phpDepend analyse because of php54 problem please add sonar.phpDepend.skip=true to your sonar configuration.