SlideShare una empresa de Scribd logo
1 de 87
Descargar para leer sin conexión
Comment surveiller la
qualité de vos projets PHP
au quotidien ?
« L'intégration continue est un ensemble de
pratiques qui consistent à véri er à chaque
changement du code source que le résultat
des modi cations ne produit pas de
régression de l'application en cours de
développement »    Wikipedia
Quels avantages ?
Quelles pratiques au
    quotidien ?
q    Maintenir un dépôt unique de code versionné
q    Tous les développeurs committent quotidiennement
q    Automatiser les compilations (builds)
q    Tout commit doit compiler le tronc du code versionné
q    Maintenir une compilation courte en permanence
q    Rendre disponible le résultat du build à tout le monde
q    Automatiser le déploiement
Alice

                                Build
                                Successful
           SCM Server
  Bob




  Carlos
                        CI Server
Alice

                                          Build Failed

                 SCM Server
  Bob




  Carlos   Alerter l’équipe   CI Server
Alice

                                Build
                                Successful
           SCM Server
  Bob




  Carlos
                        CI Server
Quelles PIC sur le
   marché ?
Mettre en œuvre
une PIC pour PHP
q    Exécution de la suite de tests unitaires (PHPUnit)
q    Génération du rapport de couverture de code (PHPUnit)
q    Génération de la documentation d’API (PHPDocumentor)
q    Génération du rapport des dépendances (PDepend)
q    Analyse statique du code source (PMD)
q    Détection des violations de codage (PHP_CodeSniffer)
q    Détection du code dupliqué (PHPCPD)
q    Génération du navigateur de code (PHP Code Browser)
q    Hudson rebaptisé Jenkins en février 2011
q    Ecrit en Java
q    Exécute des tâches Ant, Maven, Shell et Windows
q    +300 plugins
q    Analyse des rapports de compilation
q    Génération de statistiques et de graphiques (métriques)
http://jenkins-ci.org
$ java –jar jenkins.war
http://localhost:8080
q    XDebug              q    PHPUnit 3.6.x

q    PDepend             q    PHPCPD

q    PHP Mess Detector   q    PHP Documentor

q    PHP CodeSniffer      q    PHP CodeBrowser
$ pecl install xdebug

$   pear   channel-discover   pear.pdepend.org
$   pear   channel-discover   pear.phpmd.org
$   pear   channel-discover   pear.phpunit.de
$   pear   channel-discover   components.ez.no
$   pear   channel-discover   pear.symfony-project.com
$   pear   channel-discover   pear.phing.info

$   pear   install   phing/phing
$   pear   install   pdepend/PHP_Depend-beta
$   pear   install   phpmd/PHP_PMD-alpha
$   pear   install   phpunit/phpcpd
$   pear   install   PHPDocumentor
$   pear   install   PHP_CodeSniffer
$   pear   install   --alldeps phpunit/PHP_CodeBrowser-alpha
$   pear   install   --alldeps phpunit/PHPUnit
Plugins Jenkins
q    Subversion       q    JDepend
q    Git              q    PMD
q    Checkstyle       q    Violations
q    Dry              q    xUnit
q    HTML Publisher   q    Clover
q    Green Balls
Démarrer un projet
Projet free-style
Con guration du projet
Con guration du dépôt Subversion
Dé nition des droits d’accès au SVN
Con guration du dépôt Git
Con guration des builds
Exécution et contrôle du build
Exécution et contrôle du build
Phing
q    Phing est un portage de Ant en PHP
q    Outil d’automatisation de tâches
q    Phing exécute des tâches à la suite
q    Les tâches sont décrites dans un chier build.xml
q    Supporte les dépendances entre les tâches
q    Tâches prédé nies pour PHPUnit, Code Sniffer, PMD…
<?xml version="1.0" encoding="UTF-8"?>
<project name="Syndication Component" basedir="." default="main">
    <property name="builddir" value="${ws}/build" />
    <property name="srcdir"   value="${project.basedir}" override="true" />
    <property name="package" value="Syndication" override="true" />

    <target name="clean" description="Clean the build environment">
        <delete dir="${builddir}" />
        <delete dir="generatedJUnitFiles" />
    </target>

    <target name="prepare" depends="clean" description="Clean the build
environment">
        <mkdir dir="${builddir}" />
        <mkdir dir="${builddir}/logs" />
        <mkdir dir="${builddir}/logs/coverage" />
        <mkdir dir="${builddir}/docs" />
        <mkdir dir="${builddir}/browser" />
    </target>

    <target name="build" depends="prepare" description="Build the project">
        <!-- build target commands here -->
    </target>
</project>
phing –f $WORKSPACE/build.xml build –Dws=$WORKSPACE
PHPUnit
http://phpunit.de/
q    Exécuter les tests unitaires

q    Générer un rapport JUnit

q    Générer un rapport Clover XML

q    Générer un rapport de couverture HTML
<?xml version="1.0" encoding="UTF-8"?>

<phpunit backupGlobals="false" backupStaticAttributes="false"
         colors="true" convertErrorsToExceptions="true"
         convertNoticesToExceptions="true" convertWarningsToExceptions="true"
         processIsolation="true" stopOnFailure="false"
         syntaxCheck="false" bootstrap="src/autoload.php">

  <testsuites>
      <testsuite name="Syndication Component Test Suite">
          <directory>./tests/Syndication/</directory>
      </testsuite>
  </testsuites>

  <filter>
      <whitelist>
           <directory>./src/Syndication/</directory>
      </whitelist>
  </filter>
</phpunit>
<?xml version="1.0" encoding="UTF-8"?>

<project name="Syndication Component" basedir="." default="main">

   <!-- ... -->

   <target name="build" depends="prepare"
       description="Building the project">
       <phingcall target="phpunit" />
   </target>

   <target name="phpunit"
       description="Running unit tests and coverage analysis">
       <exec command="phpunit
           --log-junit ${builddir}/logs/phpunit.xml
           --coverage-clover ${builddir}/logs/coverage/clover.xml
           --coverage-html ${builddir}/logs/coverage/ ${ws}/tests"
       />
   </target>

</project>
Con gurer la suite de tests unitaires
Con gurer la couverture de code
Analyse de la couverture de code
Analyse des rapports de tests unitaires
Analyse des rapports de tests unitaires
Publication de la couverture de code
Publication de la couverture de code
PHPDocumentor
 http://www.phpdoc.org/
Générer la documentation d’API
<project name="Syndication Component" basedir="." default="main">

   <target name="build" depends="prepare">
       <phingcall target="phpunit" />
       <phingcall target="phpdoc" />
   </target>

    <!-- Generating API Documentation -->
    <target name="phpdoc" description="Generating api doc">
        <phpdoc title="Syndication API Documentation"
            destdir="${builddir}/docs" sourcecode="true"
            parseprivate="true" output="HTML:Smarty:PHP">
            <fileset dir="./src">
                <include name="**/*.php" />
            </fileset>
        </phpdoc>
    </target>
</project>
Publication de la documentation d’API
Publication de la documentation d’API
PHPCPD
     Copy Paste Detector
https://github.com/sebastianbergmann/phpcpd
Rechercher les duplications de code
<?xml version="1.0" encoding="UTF-8"?>
<project name="Syndication Component" basedir="." default="main">

    <!-- ... -->
    <target name="build" depends="prepare">
        <phingcall target="phpunit" />
        <phingcall target="phpdoc" />
        <phingcall target="phpcpd" />
    </target>

    <!-- Detecting duplicated code -->
    <target name="phpcpd" description="Detecting duplicated code">
        <exec command="phpcpd
            --min-lines 5
            --min-tokens 5
            --log-pmd ${builddir}/logs/pmd-cpd.xml src/" />
     </target>
</project>
Ce graphique montre que le
code dupliqué a bien été
retiré dans le nouveau
commit qui a donné lieu au
dernier build.



Le graphique ci-contre
montre l’évolution du nombre
de tests unitaires réussis au
dernier build.
PHP Depend
http://pdepend.org/
Analyse statique du code
q    Complexité cyclomatique
q    Qualité globale du code
q    Nombre de classes / méthodes / fonctions / interfaces
q    Nombre d’appels d’une méthode
q    Nombre de propriétés / méthodes publiques vs privées
q    Nombre de lignes de code en commentaires….
Analyse statique du code




   build/logs/jdepend.xml
<?xml version="1.0" encoding="UTF-8"?>
<project name="Syndication Component" basedir="." default="main">

    <!-- ... -->
    <target name="build" depends="prepare">
        <phingcall target="phpunit" />
        <phingcall target="phpdoc" />
        <phingcall target="phpcpd" />
        <phingcall target="pdepend" />
    </target>

    <target name="pdepend" description="Generating JDepend
report">
         <exec command="pdepend
             --jdepend-xml=${builddir}/logs/jdepend.xml src/" />
    </target>
</project>
PHP Mess Detector
  http://phpmd.org/
Analyse statique du code
q     PHP Mess Detector est un portage en PHP de PMD (Java)
q     Recherche de bugs potentiels
q     Recherche de code mort (ie: méthodes non appelées)
q     Code non optimisé
q     Expressions trop complexes…
<?xml version="1.0" encoding="UTF-8"?>
<project name="Syndication Component" basedir="." default="main">

   <!-- ... -->
   <target name="build" depends="prepare">
       <phingcall target="phpunit" />
       <phingcall target="phpdoc" />
       <phingcall target="phpcpd" />
       <phingcall target="pdepend" />
       <phingcall target="pmd" />
   </target>

    <target name="phpmd" description="Generating PHPMD report">
        <exec command="phpmd src/ xml codesize,unusedcode --
reportfile ${builddir}/logs/pmd.xml" />
    </target>

</project>
PHP Code Sniffer
http://pear.php.net/manual/en/package.php.php-codesniffer.php
q    Analyse des violations de codage

q    Nombreuses règles par défaut

q    Standards prédé nis : PEAR, Zend, Squiz, PHPCS…

q    Possibilité d’ajouter des règles supplémentaires
Installation du standard Symfony2
$ # Looking for the PEAR PHP directory
$ pear config-show | grep php_dir

$ # Move to the CodeSniffer standards folder
$ cd /path/to/pear/PHP/CodeSniffer/Standards

$ # Checkout the Symfony2 CodeSniffer standard from Github
$ git clone git://github.com/opensky/Symfony2-coding-standard.git Symfony2

$ # Eventually, set Symfony2 as your default CodeSniffer standard
$ phpcs --config-set default_standard Symfony2
Installation du standard Symfony2




   build/logs/checkstyle.xml
<?xml version="1.0" encoding="UTF-8"?>
<project name="Syndication Component" basedir="." default="main">

   <target name="build" depends="prepare">
       <phingcall target="phpunit" />
       <phingcall target="phpdoc" />
       <phingcall target="phpcpd" />
       <phingcall target="pdepend" />
       <phingcall target="phpmd" />
       <phingcall target="checkstyle" />
   </target>

   <target name="checkstyle" description="Looking for violations">
       <exec command="phpcs --standard=Symfony2 --report=checkstyle
           ${project.basedir}/src > ${builddir}/logs/checkstyle.xml"
           escape="false" />
   </target>

</project>
PHP Code Browser
https://github.com/mayflower/PHP_CodeBrowser
build/browser
<?xml version="1.0" encoding="UTF-8"?>
<project name="Syndication Component" basedir="." default="main">
    <!-- ... -->
    <target name="build" depends="prepare">
        <phingcall target="phpunit" />
        <phingcall target="phpdoc" />
        <phingcall target="phpcpd" />
        <phingcall target="pdepend" />
        <phingcall target="phpmd" />
        <phingcall target="checkstyle" />
        <phingcall target="phpcb" />
    </target>

    <target name="phpcb" description="Generating code browser...">
        <exec command="phpcb
              --log ${builddir}/logs
              --source ${project.basedir}/src
              --output ${builddir}/browser" />
    </target>
</project>
Prévenir plutôt que
      guérir!
q    Emails    q    RSS

q    Twitter   q    SMS

q    Jabber    q    …
Comment industrialiser la PIC
d’un projet PHP dans Jenkins ?
http://jenkins-php.org/
Aller plus loin avec Jenkins
q    Générer des archives PHAR, PEAR, TAR ou ZIP

q    Automatiser le déploiement des builds stables

q    Faciliter les audits de code

q    Intégration avec un bug tracker (Trac, Redmine, Jira)

q    Exécution de tests Sélénium / Fitness

q    …
Merci !
Ques%ons?	
  




 92-98, boulevard Victor Hugo
 92 115 Clichy Cedex
 trainings@sensio.com (+33 (0)1 40 99 82 11)

 sensiolabs.com - symfony.com – trainings.sensiolabs.com

Más contenido relacionado

La actualidad más candente

What's Next Replay - IC / Jenkins
What's Next Replay - IC / JenkinsWhat's Next Replay - IC / Jenkins
What's Next Replay - IC / JenkinsZenikaOuest
 
Petit déjeuner OCTO Technology - Nouvelles Architectures Web Front-End et APIs
Petit déjeuner OCTO Technology - Nouvelles Architectures Web Front-End et APIsPetit déjeuner OCTO Technology - Nouvelles Architectures Web Front-End et APIs
Petit déjeuner OCTO Technology - Nouvelles Architectures Web Front-End et APIsOCTO Technology
 
Jenkins - perdre du temps pour en gagner
Jenkins - perdre du temps pour en gagnerJenkins - perdre du temps pour en gagner
Jenkins - perdre du temps pour en gagnerGeeks Anonymes
 
AFUP Aix/Marseille - 16 mai 2017 - Open API
AFUP Aix/Marseille - 16 mai 2017 - Open APIAFUP Aix/Marseille - 16 mai 2017 - Open API
AFUP Aix/Marseille - 16 mai 2017 - Open APIRomain Cambien
 
Laravel yet another framework
Laravel  yet another frameworkLaravel  yet another framework
Laravel yet another frameworkLAHAXE Arnaud
 
Integrons en mode continu
Integrons en mode continuIntegrons en mode continu
Integrons en mode continuneuros
 
Bonnes pratiques de developpement en PHP
Bonnes pratiques de developpement en PHPBonnes pratiques de developpement en PHP
Bonnes pratiques de developpement en PHPPascal MARTIN
 
L'integration continue pour tous
L'integration continue pour tousL'integration continue pour tous
L'integration continue pour tousAurelien Navarre
 
Intégration continue transco
Intégration continue transcoIntégration continue transco
Intégration continue transcolaurent_opnworks
 
NodeJS for Mobile App
NodeJS for Mobile AppNodeJS for Mobile App
NodeJS for Mobile AppHabib MAALEM
 
ASP.NET MVC 6
ASP.NET MVC 6ASP.NET MVC 6
ASP.NET MVC 6Microsoft
 
wallabag, comment on a migré vers symfony3
wallabag, comment on a migré vers symfony3wallabag, comment on a migré vers symfony3
wallabag, comment on a migré vers symfony3Nicolas Lœuillet
 
Paris Web 2015 - Atelier desendettement javascript
Paris Web 2015 - Atelier desendettement javascriptParis Web 2015 - Atelier desendettement javascript
Paris Web 2015 - Atelier desendettement javascriptMichael Akbaraly
 
當六脈神劍遇上 PhpStorm
當六脈神劍遇上 PhpStorm當六脈神劍遇上 PhpStorm
當六脈神劍遇上 PhpStormOomusou Xiao
 
Paris Web 2015 - Atelier désendettement Javascript legacy
Paris Web 2015 - Atelier désendettement Javascript legacyParis Web 2015 - Atelier désendettement Javascript legacy
Paris Web 2015 - Atelier désendettement Javascript legacyFrançois Petitit
 
Utiliser le Zend Framework avec Symfony
Utiliser le Zend Framework avec SymfonyUtiliser le Zend Framework avec Symfony
Utiliser le Zend Framework avec SymfonyXavier Gorse
 
Intégration continue
Intégration continueIntégration continue
Intégration continueKlee Group
 
Integration continue et déploiement automatisé
Integration continue et déploiement automatiséIntegration continue et déploiement automatisé
Integration continue et déploiement automatiséJérémie Campari
 

La actualidad más candente (20)

JENKINS_BreizhJUG_20111003
JENKINS_BreizhJUG_20111003JENKINS_BreizhJUG_20111003
JENKINS_BreizhJUG_20111003
 
What's Next Replay - IC / Jenkins
What's Next Replay - IC / JenkinsWhat's Next Replay - IC / Jenkins
What's Next Replay - IC / Jenkins
 
Petit déjeuner OCTO Technology - Nouvelles Architectures Web Front-End et APIs
Petit déjeuner OCTO Technology - Nouvelles Architectures Web Front-End et APIsPetit déjeuner OCTO Technology - Nouvelles Architectures Web Front-End et APIs
Petit déjeuner OCTO Technology - Nouvelles Architectures Web Front-End et APIs
 
Jenkins - perdre du temps pour en gagner
Jenkins - perdre du temps pour en gagnerJenkins - perdre du temps pour en gagner
Jenkins - perdre du temps pour en gagner
 
AFUP Aix/Marseille - 16 mai 2017 - Open API
AFUP Aix/Marseille - 16 mai 2017 - Open APIAFUP Aix/Marseille - 16 mai 2017 - Open API
AFUP Aix/Marseille - 16 mai 2017 - Open API
 
Laravel yet another framework
Laravel  yet another frameworkLaravel  yet another framework
Laravel yet another framework
 
Integrons en mode continu
Integrons en mode continuIntegrons en mode continu
Integrons en mode continu
 
Bonnes pratiques de developpement en PHP
Bonnes pratiques de developpement en PHPBonnes pratiques de developpement en PHP
Bonnes pratiques de developpement en PHP
 
L'integration continue pour tous
L'integration continue pour tousL'integration continue pour tous
L'integration continue pour tous
 
Intégration continue transco
Intégration continue transcoIntégration continue transco
Intégration continue transco
 
NodeJS for Mobile App
NodeJS for Mobile AppNodeJS for Mobile App
NodeJS for Mobile App
 
ASP.NET MVC 6
ASP.NET MVC 6ASP.NET MVC 6
ASP.NET MVC 6
 
wallabag, comment on a migré vers symfony3
wallabag, comment on a migré vers symfony3wallabag, comment on a migré vers symfony3
wallabag, comment on a migré vers symfony3
 
Paris Web 2015 - Atelier desendettement javascript
Paris Web 2015 - Atelier desendettement javascriptParis Web 2015 - Atelier desendettement javascript
Paris Web 2015 - Atelier desendettement javascript
 
當六脈神劍遇上 PhpStorm
當六脈神劍遇上 PhpStorm當六脈神劍遇上 PhpStorm
當六脈神劍遇上 PhpStorm
 
Paris Web 2015 - Atelier désendettement Javascript legacy
Paris Web 2015 - Atelier désendettement Javascript legacyParis Web 2015 - Atelier désendettement Javascript legacy
Paris Web 2015 - Atelier désendettement Javascript legacy
 
Utiliser le Zend Framework avec Symfony
Utiliser le Zend Framework avec SymfonyUtiliser le Zend Framework avec Symfony
Utiliser le Zend Framework avec Symfony
 
Intégration continue
Intégration continueIntégration continue
Intégration continue
 
Integration continue et déploiement automatisé
Integration continue et déploiement automatiséIntegration continue et déploiement automatisé
Integration continue et déploiement automatisé
 
Des tests modernes pour Drupal
Des tests modernes pour DrupalDes tests modernes pour Drupal
Des tests modernes pour Drupal
 

Destacado

Symfony under control. Continuous Integration and Automated Deployments in Sy...
Symfony under control. Continuous Integration and Automated Deployments in Sy...Symfony under control. Continuous Integration and Automated Deployments in Sy...
Symfony under control. Continuous Integration and Automated Deployments in Sy...Max Romanovsky
 
Introduction à Symfony2
Introduction à Symfony2Introduction à Symfony2
Introduction à Symfony2Hugo Hamon
 
Auditer son code pour plus de sécurité.
Auditer son code pour plus de sécurité. Auditer son code pour plus de sécurité.
Auditer son code pour plus de sécurité. Damien Seguy
 
Télés connectées et développement Web
Télés connectées et développement WebTélés connectées et développement Web
Télés connectées et développement WebJean-Pierre Vincent
 
JCertif 2012 : Integration continue avec Jenkins
JCertif 2012 : Integration continue avec JenkinsJCertif 2012 : Integration continue avec Jenkins
JCertif 2012 : Integration continue avec JenkinsRossi Oddet
 
Présentation de PHP 5.4 [FR]
Présentation de PHP 5.4 [FR]Présentation de PHP 5.4 [FR]
Présentation de PHP 5.4 [FR]Wixiweb
 
DevFest Nantes 2016 - Spinnaker
DevFest Nantes 2016 - SpinnakerDevFest Nantes 2016 - Spinnaker
DevFest Nantes 2016 - SpinnakerStephan Lagraulet
 
NetflixOSS meetup lightning talks and roadmap
NetflixOSS meetup lightning talks and roadmapNetflixOSS meetup lightning talks and roadmap
NetflixOSS meetup lightning talks and roadmapRuslan Meshenberg
 
Presentation Symfony2
Presentation Symfony2Presentation Symfony2
Presentation Symfony2Ahmed ABATAL
 
Une application en deux heure - PHP Québec Janvier 2009
Une application en deux heure - PHP Québec Janvier 2009Une application en deux heure - PHP Québec Janvier 2009
Une application en deux heure - PHP Québec Janvier 2009Philippe Gamache
 
Design pattern in Symfony2 - Nanos gigantium humeris insidentes
Design pattern in Symfony2 - Nanos gigantium humeris insidentesDesign pattern in Symfony2 - Nanos gigantium humeris insidentes
Design pattern in Symfony2 - Nanos gigantium humeris insidentesGiulio De Donato
 
BLSTK REPLAY n 163 la revue luxe et digitale 12.05 au 18.05.16
BLSTK REPLAY n 163 la revue luxe et digitale 12.05 au 18.05.16BLSTK REPLAY n 163 la revue luxe et digitale 12.05 au 18.05.16
BLSTK REPLAY n 163 la revue luxe et digitale 12.05 au 18.05.16Balistik Art
 
symfony : Un Framework Open-Source pour les Professionnels
symfony : Un Framework Open-Source pour les Professionnelssymfony : Un Framework Open-Source pour les Professionnels
symfony : Un Framework Open-Source pour les ProfessionnelsFabien Potencier
 
[PFE] Master en ingénierie du logiciel
[PFE] Master en ingénierie du logiciel[PFE] Master en ingénierie du logiciel
[PFE] Master en ingénierie du logicielUSTHB & DELTALOG
 
Symfony2 - Un Framework PHP 5 Performant
Symfony2 - Un Framework PHP 5 PerformantSymfony2 - Un Framework PHP 5 Performant
Symfony2 - Un Framework PHP 5 PerformantHugo Hamon
 
API 101 Workshop from APIStrat Conference
API 101 Workshop from APIStrat ConferenceAPI 101 Workshop from APIStrat Conference
API 101 Workshop from APIStrat ConferenceKirsten Hunter
 
Designing for developers
Designing for developersDesigning for developers
Designing for developersKirsten Hunter
 
The History of PHPersistence
The History of PHPersistenceThe History of PHPersistence
The History of PHPersistenceHugo Hamon
 
Speed up your developments with Symfony2
Speed up your developments with Symfony2Speed up your developments with Symfony2
Speed up your developments with Symfony2Hugo Hamon
 

Destacado (20)

Symfony under control. Continuous Integration and Automated Deployments in Sy...
Symfony under control. Continuous Integration and Automated Deployments in Sy...Symfony under control. Continuous Integration and Automated Deployments in Sy...
Symfony under control. Continuous Integration and Automated Deployments in Sy...
 
Introduction à Symfony2
Introduction à Symfony2Introduction à Symfony2
Introduction à Symfony2
 
Auditer son code pour plus de sécurité.
Auditer son code pour plus de sécurité. Auditer son code pour plus de sécurité.
Auditer son code pour plus de sécurité.
 
Télés connectées et développement Web
Télés connectées et développement WebTélés connectées et développement Web
Télés connectées et développement Web
 
JCertif 2012 : Integration continue avec Jenkins
JCertif 2012 : Integration continue avec JenkinsJCertif 2012 : Integration continue avec Jenkins
JCertif 2012 : Integration continue avec Jenkins
 
Présentation de PHP 5.4 [FR]
Présentation de PHP 5.4 [FR]Présentation de PHP 5.4 [FR]
Présentation de PHP 5.4 [FR]
 
DevFest Nantes 2016 - Spinnaker
DevFest Nantes 2016 - SpinnakerDevFest Nantes 2016 - Spinnaker
DevFest Nantes 2016 - Spinnaker
 
NetflixOSS meetup lightning talks and roadmap
NetflixOSS meetup lightning talks and roadmapNetflixOSS meetup lightning talks and roadmap
NetflixOSS meetup lightning talks and roadmap
 
Presentation Symfony2
Presentation Symfony2Presentation Symfony2
Presentation Symfony2
 
Une application en deux heure - PHP Québec Janvier 2009
Une application en deux heure - PHP Québec Janvier 2009Une application en deux heure - PHP Québec Janvier 2009
Une application en deux heure - PHP Québec Janvier 2009
 
Design pattern in Symfony2 - Nanos gigantium humeris insidentes
Design pattern in Symfony2 - Nanos gigantium humeris insidentesDesign pattern in Symfony2 - Nanos gigantium humeris insidentes
Design pattern in Symfony2 - Nanos gigantium humeris insidentes
 
BLSTK REPLAY n 163 la revue luxe et digitale 12.05 au 18.05.16
BLSTK REPLAY n 163 la revue luxe et digitale 12.05 au 18.05.16BLSTK REPLAY n 163 la revue luxe et digitale 12.05 au 18.05.16
BLSTK REPLAY n 163 la revue luxe et digitale 12.05 au 18.05.16
 
symfony : Un Framework Open-Source pour les Professionnels
symfony : Un Framework Open-Source pour les Professionnelssymfony : Un Framework Open-Source pour les Professionnels
symfony : Un Framework Open-Source pour les Professionnels
 
[PFE] Master en ingénierie du logiciel
[PFE] Master en ingénierie du logiciel[PFE] Master en ingénierie du logiciel
[PFE] Master en ingénierie du logiciel
 
Symfony2 - Un Framework PHP 5 Performant
Symfony2 - Un Framework PHP 5 PerformantSymfony2 - Un Framework PHP 5 Performant
Symfony2 - Un Framework PHP 5 Performant
 
API 101 Workshop from APIStrat Conference
API 101 Workshop from APIStrat ConferenceAPI 101 Workshop from APIStrat Conference
API 101 Workshop from APIStrat Conference
 
Quantifying fitness
Quantifying fitnessQuantifying fitness
Quantifying fitness
 
Designing for developers
Designing for developersDesigning for developers
Designing for developers
 
The History of PHPersistence
The History of PHPersistenceThe History of PHPersistence
The History of PHPersistence
 
Speed up your developments with Symfony2
Speed up your developments with Symfony2Speed up your developments with Symfony2
Speed up your developments with Symfony2
 

Similar a Intégration Continue PHP avec Jenkins CI

Gitlab CI : Integration et Déploiement Continue
Gitlab CI : Integration et Déploiement ContinueGitlab CI : Integration et Déploiement Continue
Gitlab CI : Integration et Déploiement ContinueVincent Composieux
 
WordCamp Lyon 2015 - WordPress, Git et l'intégration continue
 WordCamp Lyon 2015 - WordPress, Git et l'intégration continue WordCamp Lyon 2015 - WordPress, Git et l'intégration continue
WordCamp Lyon 2015 - WordPress, Git et l'intégration continueStéphane HULARD
 
Grunt / Bower / Yeoman ou comment automatiser le développement d’un projet we...
Grunt / Bower / Yeoman ou comment automatiser le développement d’un projet we...Grunt / Bower / Yeoman ou comment automatiser le développement d’un projet we...
Grunt / Bower / Yeoman ou comment automatiser le développement d’un projet we...Microsoft
 
Grunt, Bower, Yeoman ou comment automatiser un projet web SPA
Grunt, Bower, Yeoman ou comment automatiser un projet web SPAGrunt, Bower, Yeoman ou comment automatiser un projet web SPA
Grunt, Bower, Yeoman ou comment automatiser un projet web SPATouchify
 
Réduisez vos Coûts d'Administration et les Risques d'erreurs avec Windows Pow...
Réduisez vos Coûts d'Administration et les Risques d'erreurs avec Windows Pow...Réduisez vos Coûts d'Administration et les Risques d'erreurs avec Windows Pow...
Réduisez vos Coûts d'Administration et les Risques d'erreurs avec Windows Pow...Patrick Guimonet
 
Utilisation optimale et professionnelle de PHP
Utilisation optimale et professionnelle de PHPUtilisation optimale et professionnelle de PHP
Utilisation optimale et professionnelle de PHPJean-Marc Fontaine
 
Power Shell V2 en action - avec Posh Board 2.0
Power Shell V2 en action - avec Posh Board 2.0Power Shell V2 en action - avec Posh Board 2.0
Power Shell V2 en action - avec Posh Board 2.0Patrick Guimonet
 
Node.js, le pavé dans la mare
Node.js, le pavé dans la mareNode.js, le pavé dans la mare
Node.js, le pavé dans la mareValtech
 
Pipeline Devops - Intégration continue : ansible, jenkins, docker, jmeter...
Pipeline Devops - Intégration continue : ansible, jenkins, docker, jmeter...Pipeline Devops - Intégration continue : ansible, jenkins, docker, jmeter...
Pipeline Devops - Intégration continue : ansible, jenkins, docker, jmeter...XavierPestel
 
Partie 2: Angular
Partie 2: AngularPartie 2: Angular
Partie 2: AngularHabib Ayad
 
Apache flink - prise en main rapide
Apache flink - prise en main rapideApache flink - prise en main rapide
Apache flink - prise en main rapideBilal Baltagi
 
Présentation de Django @ Orange Labs (FR)
Présentation de Django @ Orange Labs (FR)Présentation de Django @ Orange Labs (FR)
Présentation de Django @ Orange Labs (FR)Martin Latrille
 
Développer sereinement avec Node.js
Développer sereinement avec Node.jsDévelopper sereinement avec Node.js
Développer sereinement avec Node.jsJulien Giovaresco
 
Evolutions scub foundation 3.0 = 4.0
Evolutions scub foundation 3.0 =  4.0Evolutions scub foundation 3.0 =  4.0
Evolutions scub foundation 3.0 = 4.0adrienhautot
 
symfony : Simplifier le développement des interfaces bases de données (PHP ...
symfony : Simplifier le développement des interfaces bases de données (PHP ...symfony : Simplifier le développement des interfaces bases de données (PHP ...
symfony : Simplifier le développement des interfaces bases de données (PHP ...Fabien Potencier
 
Mieux Développer en PHP avec Symfony
Mieux Développer en PHP avec SymfonyMieux Développer en PHP avec Symfony
Mieux Développer en PHP avec SymfonyHugo Hamon
 
GWT : under the hood
GWT : under the hoodGWT : under the hood
GWT : under the hoodsvuillet
 
Industrialiser le contrat dans un projet PHP
Industrialiser le contrat dans un projet PHPIndustrialiser le contrat dans un projet PHP
Industrialiser le contrat dans un projet PHPhalleck45
 
Suivi de qualité PIC afup2010
Suivi de qualité PIC afup2010Suivi de qualité PIC afup2010
Suivi de qualité PIC afup2010Gabriele Santini
 

Similar a Intégration Continue PHP avec Jenkins CI (20)

Gitlab CI : Integration et Déploiement Continue
Gitlab CI : Integration et Déploiement ContinueGitlab CI : Integration et Déploiement Continue
Gitlab CI : Integration et Déploiement Continue
 
WordCamp Lyon 2015 - WordPress, Git et l'intégration continue
 WordCamp Lyon 2015 - WordPress, Git et l'intégration continue WordCamp Lyon 2015 - WordPress, Git et l'intégration continue
WordCamp Lyon 2015 - WordPress, Git et l'intégration continue
 
Grunt / Bower / Yeoman ou comment automatiser le développement d’un projet we...
Grunt / Bower / Yeoman ou comment automatiser le développement d’un projet we...Grunt / Bower / Yeoman ou comment automatiser le développement d’un projet we...
Grunt / Bower / Yeoman ou comment automatiser le développement d’un projet we...
 
Grunt, Bower, Yeoman ou comment automatiser un projet web SPA
Grunt, Bower, Yeoman ou comment automatiser un projet web SPAGrunt, Bower, Yeoman ou comment automatiser un projet web SPA
Grunt, Bower, Yeoman ou comment automatiser un projet web SPA
 
Réduisez vos Coûts d'Administration et les Risques d'erreurs avec Windows Pow...
Réduisez vos Coûts d'Administration et les Risques d'erreurs avec Windows Pow...Réduisez vos Coûts d'Administration et les Risques d'erreurs avec Windows Pow...
Réduisez vos Coûts d'Administration et les Risques d'erreurs avec Windows Pow...
 
Utilisation optimale et professionnelle de PHP
Utilisation optimale et professionnelle de PHPUtilisation optimale et professionnelle de PHP
Utilisation optimale et professionnelle de PHP
 
Power Shell V2 en action - avec Posh Board 2.0
Power Shell V2 en action - avec Posh Board 2.0Power Shell V2 en action - avec Posh Board 2.0
Power Shell V2 en action - avec Posh Board 2.0
 
Node.js, le pavé dans la mare
Node.js, le pavé dans la mareNode.js, le pavé dans la mare
Node.js, le pavé dans la mare
 
Pipeline Devops - Intégration continue : ansible, jenkins, docker, jmeter...
Pipeline Devops - Intégration continue : ansible, jenkins, docker, jmeter...Pipeline Devops - Intégration continue : ansible, jenkins, docker, jmeter...
Pipeline Devops - Intégration continue : ansible, jenkins, docker, jmeter...
 
Partie 2: Angular
Partie 2: AngularPartie 2: Angular
Partie 2: Angular
 
Apache flink - prise en main rapide
Apache flink - prise en main rapideApache flink - prise en main rapide
Apache flink - prise en main rapide
 
Présentation de Django @ Orange Labs (FR)
Présentation de Django @ Orange Labs (FR)Présentation de Django @ Orange Labs (FR)
Présentation de Django @ Orange Labs (FR)
 
Développer sereinement avec Node.js
Développer sereinement avec Node.jsDévelopper sereinement avec Node.js
Développer sereinement avec Node.js
 
Evolutions scub foundation 3.0 = 4.0
Evolutions scub foundation 3.0 =  4.0Evolutions scub foundation 3.0 =  4.0
Evolutions scub foundation 3.0 = 4.0
 
symfony : Simplifier le développement des interfaces bases de données (PHP ...
symfony : Simplifier le développement des interfaces bases de données (PHP ...symfony : Simplifier le développement des interfaces bases de données (PHP ...
symfony : Simplifier le développement des interfaces bases de données (PHP ...
 
Mieux Développer en PHP avec Symfony
Mieux Développer en PHP avec SymfonyMieux Développer en PHP avec Symfony
Mieux Développer en PHP avec Symfony
 
GWT : under the hood
GWT : under the hoodGWT : under the hood
GWT : under the hood
 
12-Factor
12-Factor12-Factor
12-Factor
 
Industrialiser le contrat dans un projet PHP
Industrialiser le contrat dans un projet PHPIndustrialiser le contrat dans un projet PHP
Industrialiser le contrat dans un projet PHP
 
Suivi de qualité PIC afup2010
Suivi de qualité PIC afup2010Suivi de qualité PIC afup2010
Suivi de qualité PIC afup2010
 

Más de Hugo Hamon

Design Patterns avec PHP 5.3, Symfony et Pimple
Design Patterns avec PHP 5.3, Symfony et PimpleDesign Patterns avec PHP 5.3, Symfony et Pimple
Design Patterns avec PHP 5.3, Symfony et PimpleHugo Hamon
 
Monitor the quality of your Symfony projects
Monitor the quality of your Symfony projectsMonitor the quality of your Symfony projects
Monitor the quality of your Symfony projectsHugo Hamon
 
Database Design Patterns
Database Design PatternsDatabase Design Patterns
Database Design PatternsHugo Hamon
 
Silex meets SOAP & REST
Silex meets SOAP & RESTSilex meets SOAP & REST
Silex meets SOAP & RESTHugo Hamon
 
Symfony2 - extending the console component
Symfony2 - extending the console componentSymfony2 - extending the console component
Symfony2 - extending the console componentHugo Hamon
 
Développeurs, cachez-moi ça ! (Paris Web 2011)
Développeurs, cachez-moi ça ! (Paris Web 2011)Développeurs, cachez-moi ça ! (Paris Web 2011)
Développeurs, cachez-moi ça ! (Paris Web 2011)Hugo Hamon
 
Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Hugo Hamon
 
Symfony2 en pièces détachées
Symfony2 en pièces détachéesSymfony2 en pièces détachées
Symfony2 en pièces détachéesHugo Hamon
 
Exposer des services web SOAP et REST avec symfony 1.4 et Zend Framework
Exposer des services web SOAP et REST avec symfony 1.4 et Zend FrameworkExposer des services web SOAP et REST avec symfony 1.4 et Zend Framework
Exposer des services web SOAP et REST avec symfony 1.4 et Zend FrameworkHugo Hamon
 

Más de Hugo Hamon (9)

Design Patterns avec PHP 5.3, Symfony et Pimple
Design Patterns avec PHP 5.3, Symfony et PimpleDesign Patterns avec PHP 5.3, Symfony et Pimple
Design Patterns avec PHP 5.3, Symfony et Pimple
 
Monitor the quality of your Symfony projects
Monitor the quality of your Symfony projectsMonitor the quality of your Symfony projects
Monitor the quality of your Symfony projects
 
Database Design Patterns
Database Design PatternsDatabase Design Patterns
Database Design Patterns
 
Silex meets SOAP & REST
Silex meets SOAP & RESTSilex meets SOAP & REST
Silex meets SOAP & REST
 
Symfony2 - extending the console component
Symfony2 - extending the console componentSymfony2 - extending the console component
Symfony2 - extending the console component
 
Développeurs, cachez-moi ça ! (Paris Web 2011)
Développeurs, cachez-moi ça ! (Paris Web 2011)Développeurs, cachez-moi ça ! (Paris Web 2011)
Développeurs, cachez-moi ça ! (Paris Web 2011)
 
Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2
 
Symfony2 en pièces détachées
Symfony2 en pièces détachéesSymfony2 en pièces détachées
Symfony2 en pièces détachées
 
Exposer des services web SOAP et REST avec symfony 1.4 et Zend Framework
Exposer des services web SOAP et REST avec symfony 1.4 et Zend FrameworkExposer des services web SOAP et REST avec symfony 1.4 et Zend Framework
Exposer des services web SOAP et REST avec symfony 1.4 et Zend Framework
 

Intégration Continue PHP avec Jenkins CI

  • 1.
  • 2. Comment surveiller la qualité de vos projets PHP au quotidien ?
  • 3. « L'intégration continue est un ensemble de pratiques qui consistent à véri er à chaque changement du code source que le résultat des modi cations ne produit pas de régression de l'application en cours de développement » Wikipedia
  • 5. Quelles pratiques au quotidien ?
  • 6. q  Maintenir un dépôt unique de code versionné q  Tous les développeurs committent quotidiennement q  Automatiser les compilations (builds) q  Tout commit doit compiler le tronc du code versionné q  Maintenir une compilation courte en permanence q  Rendre disponible le résultat du build à tout le monde q  Automatiser le déploiement
  • 7. Alice Build Successful SCM Server Bob Carlos CI Server
  • 8. Alice Build Failed SCM Server Bob Carlos Alerter l’équipe CI Server
  • 9. Alice Build Successful SCM Server Bob Carlos CI Server
  • 10. Quelles PIC sur le marché ?
  • 11.
  • 12. Mettre en œuvre une PIC pour PHP
  • 13. q  Exécution de la suite de tests unitaires (PHPUnit) q  Génération du rapport de couverture de code (PHPUnit) q  Génération de la documentation d’API (PHPDocumentor) q  Génération du rapport des dépendances (PDepend) q  Analyse statique du code source (PMD) q  Détection des violations de codage (PHP_CodeSniffer) q  Détection du code dupliqué (PHPCPD) q  Génération du navigateur de code (PHP Code Browser)
  • 14.
  • 15. q  Hudson rebaptisé Jenkins en février 2011 q  Ecrit en Java q  Exécute des tâches Ant, Maven, Shell et Windows q  +300 plugins q  Analyse des rapports de compilation q  Génération de statistiques et de graphiques (métriques)
  • 16.
  • 18. $ java –jar jenkins.war
  • 20. q  XDebug q  PHPUnit 3.6.x q  PDepend q  PHPCPD q  PHP Mess Detector q  PHP Documentor q  PHP CodeSniffer q  PHP CodeBrowser
  • 21. $ pecl install xdebug $ pear channel-discover pear.pdepend.org $ pear channel-discover pear.phpmd.org $ pear channel-discover pear.phpunit.de $ pear channel-discover components.ez.no $ pear channel-discover pear.symfony-project.com $ pear channel-discover pear.phing.info $ pear install phing/phing $ pear install pdepend/PHP_Depend-beta $ pear install phpmd/PHP_PMD-alpha $ pear install phpunit/phpcpd $ pear install PHPDocumentor $ pear install PHP_CodeSniffer $ pear install --alldeps phpunit/PHP_CodeBrowser-alpha $ pear install --alldeps phpunit/PHPUnit
  • 23. q  Subversion q  JDepend q  Git q  PMD q  Checkstyle q  Violations q  Dry q  xUnit q  HTML Publisher q  Clover q  Green Balls
  • 26. Con guration du projet
  • 27. Con guration du dépôt Subversion
  • 28. Dé nition des droits d’accès au SVN
  • 29. Con guration du dépôt Git
  • 33. Phing
  • 34. q  Phing est un portage de Ant en PHP q  Outil d’automatisation de tâches q  Phing exécute des tâches à la suite q  Les tâches sont décrites dans un chier build.xml q  Supporte les dépendances entre les tâches q  Tâches prédé nies pour PHPUnit, Code Sniffer, PMD…
  • 35. <?xml version="1.0" encoding="UTF-8"?> <project name="Syndication Component" basedir="." default="main"> <property name="builddir" value="${ws}/build" /> <property name="srcdir" value="${project.basedir}" override="true" /> <property name="package" value="Syndication" override="true" /> <target name="clean" description="Clean the build environment"> <delete dir="${builddir}" /> <delete dir="generatedJUnitFiles" /> </target> <target name="prepare" depends="clean" description="Clean the build environment"> <mkdir dir="${builddir}" /> <mkdir dir="${builddir}/logs" /> <mkdir dir="${builddir}/logs/coverage" /> <mkdir dir="${builddir}/docs" /> <mkdir dir="${builddir}/browser" /> </target> <target name="build" depends="prepare" description="Build the project"> <!-- build target commands here --> </target> </project>
  • 36. phing –f $WORKSPACE/build.xml build –Dws=$WORKSPACE
  • 38. q  Exécuter les tests unitaires q  Générer un rapport JUnit q  Générer un rapport Clover XML q  Générer un rapport de couverture HTML
  • 39. <?xml version="1.0" encoding="UTF-8"?> <phpunit backupGlobals="false" backupStaticAttributes="false" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="true" stopOnFailure="false" syntaxCheck="false" bootstrap="src/autoload.php"> <testsuites> <testsuite name="Syndication Component Test Suite"> <directory>./tests/Syndication/</directory> </testsuite> </testsuites> <filter> <whitelist> <directory>./src/Syndication/</directory> </whitelist> </filter> </phpunit>
  • 40. <?xml version="1.0" encoding="UTF-8"?> <project name="Syndication Component" basedir="." default="main"> <!-- ... --> <target name="build" depends="prepare" description="Building the project"> <phingcall target="phpunit" /> </target> <target name="phpunit" description="Running unit tests and coverage analysis"> <exec command="phpunit --log-junit ${builddir}/logs/phpunit.xml --coverage-clover ${builddir}/logs/coverage/clover.xml --coverage-html ${builddir}/logs/coverage/ ${ws}/tests" /> </target> </project>
  • 41. Con gurer la suite de tests unitaires
  • 42. Con gurer la couverture de code
  • 43. Analyse de la couverture de code
  • 44. Analyse des rapports de tests unitaires
  • 45. Analyse des rapports de tests unitaires
  • 46. Publication de la couverture de code
  • 47. Publication de la couverture de code
  • 50. <project name="Syndication Component" basedir="." default="main"> <target name="build" depends="prepare"> <phingcall target="phpunit" /> <phingcall target="phpdoc" /> </target> <!-- Generating API Documentation --> <target name="phpdoc" description="Generating api doc"> <phpdoc title="Syndication API Documentation" destdir="${builddir}/docs" sourcecode="true" parseprivate="true" output="HTML:Smarty:PHP"> <fileset dir="./src"> <include name="**/*.php" /> </fileset> </phpdoc> </target> </project>
  • 51. Publication de la documentation d’API
  • 52. Publication de la documentation d’API
  • 53. PHPCPD Copy Paste Detector https://github.com/sebastianbergmann/phpcpd
  • 55. <?xml version="1.0" encoding="UTF-8"?> <project name="Syndication Component" basedir="." default="main"> <!-- ... --> <target name="build" depends="prepare"> <phingcall target="phpunit" /> <phingcall target="phpdoc" /> <phingcall target="phpcpd" /> </target> <!-- Detecting duplicated code --> <target name="phpcpd" description="Detecting duplicated code"> <exec command="phpcpd --min-lines 5 --min-tokens 5 --log-pmd ${builddir}/logs/pmd-cpd.xml src/" /> </target> </project>
  • 56.
  • 57.
  • 58. Ce graphique montre que le code dupliqué a bien été retiré dans le nouveau commit qui a donné lieu au dernier build. Le graphique ci-contre montre l’évolution du nombre de tests unitaires réussis au dernier build.
  • 60. Analyse statique du code q  Complexité cyclomatique q  Qualité globale du code q  Nombre de classes / méthodes / fonctions / interfaces q  Nombre d’appels d’une méthode q  Nombre de propriétés / méthodes publiques vs privées q  Nombre de lignes de code en commentaires….
  • 61. Analyse statique du code build/logs/jdepend.xml
  • 62. <?xml version="1.0" encoding="UTF-8"?> <project name="Syndication Component" basedir="." default="main"> <!-- ... --> <target name="build" depends="prepare"> <phingcall target="phpunit" /> <phingcall target="phpdoc" /> <phingcall target="phpcpd" /> <phingcall target="pdepend" /> </target> <target name="pdepend" description="Generating JDepend report"> <exec command="pdepend --jdepend-xml=${builddir}/logs/jdepend.xml src/" /> </target> </project>
  • 63.
  • 64. PHP Mess Detector http://phpmd.org/
  • 65. Analyse statique du code q  PHP Mess Detector est un portage en PHP de PMD (Java) q  Recherche de bugs potentiels q  Recherche de code mort (ie: méthodes non appelées) q  Code non optimisé q  Expressions trop complexes…
  • 66.
  • 67. <?xml version="1.0" encoding="UTF-8"?> <project name="Syndication Component" basedir="." default="main"> <!-- ... --> <target name="build" depends="prepare"> <phingcall target="phpunit" /> <phingcall target="phpdoc" /> <phingcall target="phpcpd" /> <phingcall target="pdepend" /> <phingcall target="pmd" /> </target> <target name="phpmd" description="Generating PHPMD report"> <exec command="phpmd src/ xml codesize,unusedcode -- reportfile ${builddir}/logs/pmd.xml" /> </target> </project>
  • 68.
  • 70. q  Analyse des violations de codage q  Nombreuses règles par défaut q  Standards prédé nis : PEAR, Zend, Squiz, PHPCS… q  Possibilité d’ajouter des règles supplémentaires
  • 71. Installation du standard Symfony2 $ # Looking for the PEAR PHP directory $ pear config-show | grep php_dir $ # Move to the CodeSniffer standards folder $ cd /path/to/pear/PHP/CodeSniffer/Standards $ # Checkout the Symfony2 CodeSniffer standard from Github $ git clone git://github.com/opensky/Symfony2-coding-standard.git Symfony2 $ # Eventually, set Symfony2 as your default CodeSniffer standard $ phpcs --config-set default_standard Symfony2
  • 72. Installation du standard Symfony2 build/logs/checkstyle.xml
  • 73. <?xml version="1.0" encoding="UTF-8"?> <project name="Syndication Component" basedir="." default="main"> <target name="build" depends="prepare"> <phingcall target="phpunit" /> <phingcall target="phpdoc" /> <phingcall target="phpcpd" /> <phingcall target="pdepend" /> <phingcall target="phpmd" /> <phingcall target="checkstyle" /> </target> <target name="checkstyle" description="Looking for violations"> <exec command="phpcs --standard=Symfony2 --report=checkstyle ${project.basedir}/src > ${builddir}/logs/checkstyle.xml" escape="false" /> </target> </project>
  • 74.
  • 75.
  • 78. <?xml version="1.0" encoding="UTF-8"?> <project name="Syndication Component" basedir="." default="main"> <!-- ... --> <target name="build" depends="prepare"> <phingcall target="phpunit" /> <phingcall target="phpdoc" /> <phingcall target="phpcpd" /> <phingcall target="pdepend" /> <phingcall target="phpmd" /> <phingcall target="checkstyle" /> <phingcall target="phpcb" /> </target> <target name="phpcb" description="Generating code browser..."> <exec command="phpcb --log ${builddir}/logs --source ${project.basedir}/src --output ${builddir}/browser" /> </target> </project>
  • 79.
  • 81. q  Emails q  RSS q  Twitter q  SMS q  Jabber q  …
  • 82. Comment industrialiser la PIC d’un projet PHP dans Jenkins ?
  • 84. Aller plus loin avec Jenkins
  • 85. q  Générer des archives PHAR, PEAR, TAR ou ZIP q  Automatiser le déploiement des builds stables q  Faciliter les audits de code q  Intégration avec un bug tracker (Trac, Redmine, Jira) q  Exécution de tests Sélénium / Fitness q  …
  • 87. Ques%ons?   92-98, boulevard Victor Hugo 92 115 Clichy Cedex trainings@sensio.com (+33 (0)1 40 99 82 11) sensiolabs.com - symfony.com – trainings.sensiolabs.com