Integration continue
-
Upload
eric-hogue -
Category
Technology
-
view
1.288 -
download
1
Transcript of Integration continue
Installer ant et Jenkinssudo apt-get install default-jdk ant
Suivre les instructions sur le site de jenkins
Installer les plugins• Git Plugin• Github Plugin• Green Balls
Installation
sudo apt-get install php5-xdebug php-pearsudo pear upgrade pearsudo pear channel-discover pear.phpunit.desudo pear channel-discover components.ez.nosudo pear channel-discover pear.symfony-project.comsudo pear install phpunit/PHPUnit
phpunit.xml<phpunit bootstrap="Tests/bootstrap.php"> <testsuites> <testsuite name="Demo"> <directory>.</directory></testsuite> </testsuites> <logging> <log type="coverage-html" target="build/phpunit/html" title="CIDemo" charset="UTF-8" yui="true" highlight="true" lowUpperBound="35" highLowerBound="70" /> <log type="coverage-clover" target="build/phpunit/clover.xml"/> <log type="junit" target="build/phpunit/junit.xml" logIncompleteSkipped="false" /> </logging></phpunit>
build.xml<project name="CIDemo" default="build" basedir="."> <property name="output" location="${basedir}/build/" /> <target name="build" depends="prepare,phpunit"> </target> <target name="prepare" depends="clean"> <mkdir dir="${output}" /> </target> <target name="clean"> <delete dir="${output}" /> </target>
<target name="phpunit"> <exec executable="phpunit" failonerror="true" /> </target></project>
sudo pear install PHP_CodeSnifferInstallation:
build.xml<target name="phpcs"><exec executable="phpcs"><arg line="--report=checkstyle--report-file=${output}/phpcs/checkstyle.xml--standard=Zend${basedir}" /></exec></target>
sudo pear channel-discover pear.pdepend.orgsudo pear install pdepend/PHP_Depend-beta
Installation:
build.xml <target name="pdepend"> <exec executable="pdepend"> <arg line=" --jdepend-xml=${output}/pdepend/jdepend.xml--jdepend-chart=${output}/pdepend/dependencies.svg --overview-pyramid=${output}/pdepend/overview-pyramid.svg--ignore=Tests/. " /> </exec> </target>
sudo pear channel-discover pear.phpmd.orgsudo pear channel-discover pear.pdepend.orgsudo pear install --alldeps phpmd/PHP_PMD
Installation:
build.xml<target name="phpmd"> <exec executable="phpmd"><arg line=". xml codesize,unusedcode,naming,design --reportfile ${output}/phpmd/messdetector.xml --exclude Tests/" /> </exec></target>
sudo pear channel-discover pear.phpunit.desudo pear channel-discover components.ez.nosudo pear install phpunit/phpcpd
Installation:
build.xml<target name="phpcpd" depends="prepare"> <exec executable="phpcpd"> <arg line=" --log-pmd ${output}/phpcpd/phpcpd.xml --min-tokens 30 ." /> </exec></target>
http://jenkins-php.org/
Tout ce qu'il faut pour un projet PHP
• Les plugins nécessaires• Un fichier build.xml• Un template pour Jenkins• PHP Project Wizard (PPW)
Autres possibilités
• Phing/Rake• Autres tests (Selenium, Behat)• Déployement automatique/continue• ...
Questions?
• GitHub: https://github.com/EricHogue/• SlideShare: http://www.slideshare.net/EricHogue
• Blog: http://erichogue.ca/• Twitter: @ehogue• Email: [email protected]• LinkedIn http://ca.linkedin.com/in/ehogue
Contact: