Permalink
Browse files

issue #6: cleaning up the jenkins CI build file

  • Loading branch information...
1 parent 4308a7a commit f4ec072344700f4403504dd42f07f47c230afa61 @DragonBe committed May 18, 2011
Showing with 76 additions and 83 deletions.
  1. +69 −76 jenkins.xml
  2. +6 −0 pdepend.xml
  3. +1 −1 tests/log/testdox.html
  4. +0 −6 tests/phpunit.xml
View
@@ -1,108 +1,101 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Always run the Phing build script with the Jenkin user as follows:
+ sudo -u jenkins phing -f jenkins.xml
+
+ If you want to print extra debug info, pass the following parameter:
+ sudo -u jenkins phing -f jenkins.xml -Dpassthru=true
+-->
<project name="Continuous Integration" default="build">
- <property name="basedir" value="${project.basedir}"/>
+ <property name="project.name" value="Wingz"/>
+ <property name="passthru" value="false"/>
- <fileset id="php-files" dir="./">
+ <fileset id="php-files" dir="${project.basedir}">
<include name="**/*.php"/>
- <exclude name="**/.svn**"/>
- <exclude name="**/*.phtml"/>
<exclude name="library/Zend/**"/>
<exclude name="library/ZendX/**"/>
- <exclude name="library/Macq/**"/>
- <exclude name="scripts/**"/>
<exclude name="tests/**"/>
- <exclude name="docs/**"/>
</fileset>
- <target name="clean" description="Cleaning up artifacts directory">
- <delete dir="${basedir}/build/api"/>
- <delete dir="${basedir}/build/code-browser"/>
- <delete dir="${basedir}/build/statsvn"/>
- <delete dir="${basedir}/build/coverage"/>
- <delete dir="${basedir}/build/logs"/>
- <delete dir="${basedir}/build/pdepend"/>
- <delete dir="${basedir}/build/cache"/>
+ <target name="clean" description="Cleaning up build artifacts">
+ <delete dir="${project.basedir}/build/api"/>
+ <delete dir="${project.basedir}/build/code-browser"/>
+ <delete dir="${project.basedir}/build/coverage"/>
+ <delete dir="${project.basedir}/build/logs"/>
+ <delete dir="${project.basedir}/build/pdepend"/>
+ <mkdir dir="${project.basedir}/build/api"/>
+ <mkdir dir="${project.basedir}/build/code-browser"/>
+ <mkdir dir="${project.basedir}/build/coverage"/>
+ <mkdir dir="${project.basedir}/build/logs"/>
+ <mkdir dir="${project.basedir}/build/pdepend"/>
+ </target>
- <mkdir dir="${basedir}/build/api"/>
- <mkdir dir="${basedir}/build/code-browser"/>
- <mkdir dir="${basedir}/build/statsvn"/>
- <mkdir dir="${basedir}/build/coverage"/>
- <mkdir dir="${basedir}/build/logs"/>
- <mkdir dir="${basedir}/build/pdepend"/>
- <mkdir dir="${basedir}/build/cache"/>
+ <target name="phpdoc" description="Generate API documentation">
+ <phpdoc
+ title="${project.name} API Documentation"
+ target="${project.basedir}/build/api"
+ output="HTML:frames:earthli"
+ quiet="true">
+ <fileset refid="php-files"/>
+ </phpdoc>
</target>
- <target name="phpunit" description="Running unit tests and generates code-coverage reports">
- <exec command="phpunit
- --log-junit ${basedir}/build/logs/junit.xml
- --coverage-clover ${basedir}/build/logs/clover.xml
- --coverage-html ${basedir}/build/coverage"
- dir="${basedir}/tests"/>
+ <target name="phpunit" description="Run unit tests on codebase and generate code coverage">
+ <exec passthru="${passthru}" dir="${project.basedir}/tests" command="phpunit
+ --log-junit=${project.basedir}/build/logs/junit.xml
+ --coverage-clover=${project.basedir}/build/logs/clover.xml
+ --coverage-html=${project.basedir}/build/coverage"/>
</target>
- <target name="pdepend" description="Calculate dependencies of code base">
- <exec command="pdepend
- --configuration=${basedir}/pdepend.xml
- --jdepend-chart=${basedir}/build/pdepend/dependencies.svg
- --jdepend-xml=${basedir}/build/logs/jdepend.xml
- --overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg
- --suffix=php
- --ignore=library/Zend,library/ZendX,tests,docs,scripts ${basedir}"/>
+ <target name="phpcpd" description="Copy/Paste detection">
+ <phpcpd>
+ <fileset refid="php-files"/>
+ <formatter type="pmd" outfile="${project.basedir}/build/logs/pmd-cpd.xml"/>
+ </phpcpd>
</target>
<target name="phpmd" description="Generate pmd.xml using PHPMD">
<phpmd>
- <fileset refid="php-files" />
- <formatter type="xml" outfile="${basedir}/build/logs/pmd.xml"/>
+ <fileset refid="php-files"/>
+ <formatter type="xml" outfile="${project.basedir}/build/logs/pmd.xml"/>
</phpmd>
</target>
- <target name="phpcpd" description="Detection of copy/paste">
- <exec command="phpcpd
- --log-pmd ${basedir}/build/logs/pmd-cpd.xml
- --exclude library/Zend
- --exclude library/ZendX
- --exclude tests
- --exclude docs
- --exclude scripts
- --suffixes php
- ${basedir}"/>
+ <target name="pdepend" description="Calculate dependencies of the code base">
+ <exec passthru="${passthru}" dir="${project.basedir}" command="pdepend
+ --configuration=${project.basedir}/pdepend.xml
+ --jdepend-chart=${project.basedir}/build/pdepend/dependencies.svg
+ --jdepend-xml=${project.basedir}/build/logs/jdepend.xml
+ --overview-pyramid=${project.basedir}/build/pdepend/overview-pyramid.svg
+ --suffix=php
+ --ignore=library/Zend,library/ZendX,tests
+ ${project.basedir}"/>
</target>
<target name="phploc" description="Generate phploc.csv">
- <exec command="phploc
- --log-csv ${basedir}/build/logs/phploc.csv ${basedir}"/>
- </target>
-
- <target name="phpcs" description="Checking our coding standards">
- <exec command="phpcs
- --report=checkstyle
- --report-file=${basedir}/build/logs/checkstyle.xml
- --standard=Zend
- --ignore=library/Zend,library/ZendX,tests,docs,scripts
- --extensions=php
- ${basedir}"/>
- </target>
-
- <target name="phpdoc" description="Generate API documentation">
- <phpdoc
- title="iCar Manager API Documentation"
- target="${basedir}/build/api"
- output="HTML:frames:earthli"
- quiet="true">
- <fileset refid="php-files" />
- </phpdoc>
+ <exec passthru="${passthru}" command="phploc
+ --log-csv ${project.basedir}/build/logs/phploc.csv
+ ${project.basedir}"/>
</target>
<target name="phpcb" description="Aggregate tool output with PHP_CodeBrowser">
- <exec command="phpcb
- --ignore library/Zend,library/ZendX,tests,docs,scripts
- --log ${basedir}/build/logs
- --source ${basedir}
- --output ${basedir}/build/code-browser"/>
+ <exec passthru="${passthru}" command="phpcb
+ --ignore library/Zend,library/ZendX,tests,docs
+ --log ${project.basedir}/build/logs
+ --source ${project.basedir}
+ --output ${project.basedir}/build/code-browser"/>
</target>
- <target name="build" depends="clean, phpunit, phpdoc, pdepend, phpmd, phpcs, phploc, phpcpd"/>
+ <target name="build" description="Start analyzing our application">
+ <phingCall target="clean"/>
+ <phingCall target="phpdoc"/>
+ <phingCall target="phpunit"/>
+ <phingCall target="phpcpd"/>
+ <phingCall target="phpmd"/>
+ <phingCall target="pdepend"/>
+ <phingCall target="phploc"/>
+ <phingCall target="phpcb"/>
+ </target>
</project>
View
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+ <cache>
+ <location>build/cache</location>
+ </cache>
+</configuration>
View
@@ -1 +1 @@
-<html><body><h2 id="Wingz_Service_JoindinTest">Wingz_Service_Joindin</h2><ul><li>Joindin service can be instantiated</li><li>Joindin service status</li><li>Joindin list events</li><li>Joinin list events with count</li><li>Joindin get event detail</li><li>Joindin get event talks</li></ul></body></html>
+<html><body><h2 id="ErrorControllerTest">ErrorController</h2><ul><li>Error page is approachable and displays message</li><li>Bogus page returns page not found</li></ul><h2 id="FaqControllerTest">FaqController</h2><ul><li>Faq page displays questions</li></ul><h2 id="IndexControllerTest">IndexController</h2><ul><li>Index page is reachable</li></ul><h2 id="TourControllerTest">TourController</h2><ul><li>Tour page displays steps to start</li></ul><h2 id="Application_Model_EventTest">Application_Model_Event</h2><ul><li>Event is empty</li><li>Event can contain data</li></ul><h2 id="Application_Model_RoleTest">Application_Model_Role</h2><ul><li>Role is empty</li><li>Role contains correct data</li><li>Role can be populated at construct</li></ul><h2 id="Application_Model_UserTest">Application_Model_User</h2><ul><li>Model is empty</li><li>User contains correct data</li><li>User can be populated at construct</li></ul><h2 id="Auth_IndexControllerTest">Auth_IndexController</h2><ul><li><strike>Index displays login screen</strike></li></ul><h2 id="FacebookControllerTest">FacebookController</h2><ul><li>Button displayed without facebook connect</li></ul><h2 id="Oauth_IdenticaControllerTest">Oauth_IdenticaController</h2><ul><li>Index action</li><li>Auth action</li><li>Login action</li><li>Message action</li></ul><h2 id="TwitterControllerTest">TwitterController</h2><ul><li>Twitter displays link when not authenticated</li></ul><h2 id="Wingz_Model_EventLogoTest">Wingz_Model_EventLogo</h2><ul><li>Set url</li><li>Get url</li><li>Set width</li><li>Get width</li><li>Set height</li><li>Get height</li><li>Set alt</li><li>Get alt</li><li>Populate</li><li>To array</li><li>Construct with array</li><li>Construct with params</li><li>To string</li></ul><h2 id="Wingz_Service_JoindinTest">Wingz_Service_Joindin</h2><ul><li>Joindin service can be instantiated</li><li>Joindin service status</li><li>Joindin list events</li><li>Joinin list events with count</li><li>Joindin get event detail</li><li>Joindin get event talks</li></ul><h2 id="Wingz_View_Helper_EventListItemTest">Wingz_View_Helper_EventListItem</h2><ul><li>View helper generates template</li></ul></body></html>
View
@@ -13,10 +13,4 @@
</exclude>
</whitelist>
</filter>
-
- <logging>
- <log type="coverage-html" target="./log/report" charset="UTF-8"
- yui="true" highlight="true" lowUpperBound="50" highLowerBound="80"/>
- <log type="testdox-html" target="./log/testdox.html" />
- </logging>
</phpunit>

0 comments on commit f4ec072

Please sign in to comment.