Last active
August 29, 2015 14:04
-
-
Save derhansen/7f13e431dc0d6413099a to your computer and use it in GitHub Desktop.
Example ANT file for a TYPO3 6.2 ExtBase extension to use with Jenkins CI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project name="TYPO3-62-Extbase-Extension" default="build" basedir="."> | |
<property environment="env"/> | |
<target name="build" depends="init, tests, phpcs, phpmd, phpcpd, cleanup"> | |
</target> | |
<target name="init"> | |
<mkdir dir="${env.WORKSPACE}/build"/> | |
<mkdir dir="${env.WORKSPACE}/build/phpcs"/> | |
<mkdir dir="${env.WORKSPACE}/build/phpunit"/> | |
<mkdir dir="${env.WORKSPACE}/typo3_core"/> | |
</target> | |
<target name="tests"> | |
<exec executable="git" failonerror="true"> | |
<arg line="clone --single-branch --branch master --depth 1 https://github.com/TYPO3/TYPO3.CMS.git ${env.WORKSPACE}/typo3_core" /> | |
</exec> | |
<exec executable="composer"> | |
<arg line="install --working-dir ${env.WORKSPACE}/typo3_core" /> | |
</exec> | |
<mkdir dir="${env.WORKSPACE}/typo3_core/uploads"/> | |
<mkdir dir="${env.WORKSPACE}/typo3_core/typo3temp"/> | |
<mkdir dir="${env.WORKSPACE}/typo3_core/typo3conf/ext"/> | |
<symlink link="${env.WORKSPACE}/typo3_core/typo3conf/ext/${env.JOB_NAME}" resource="${env.WORKSPACE}/${env.JOB_NAME}"/> | |
<exec executable="phpunit" dir="${env.WORKSPACE}/typo3_core"> | |
<arg line="--log-junit ${env.WORKSPACE}/build/phpunit/unittests.xml --bootstrap typo3/sysext/core/Build/UnitTestsBootstrap.php typo3conf/ext/${env.JOB_NAME}/Tests/Unit" /> | |
</exec> | |
<exec executable="${env.WORKSPACE}/typo3_core/bin/phpunit" dir="${env.WORKSPACE}/typo3_core"> | |
<env key="TYPO3_PATH_WEB" value="${env.WORKSPACE}/typo3_core"/> | |
<env key="typo3DatabaseName" value="typo3"/> | |
<env key="typo3DatabaseHost" value="localhost"/> | |
<env key="typo3DatabaseUsername" value="root"/> | |
<env key="typo3DatabasePassword" value=""/> | |
<arg line="--log-junit ${env.WORKSPACE}/build/phpunit/functionaltests.xml --process-isolation --bootstrap typo3/sysext/core/Build/FunctionalTestsBootstrap.php typo3conf/ext/${env.JOB_NAME}/Tests/Functional" /> | |
</exec> | |
</target> | |
<target name="phpcs"> | |
<exec executable="phpcs"> | |
<arg line="--report=checkstyle | |
--report-file=${env.WORKSPACE}/build/phpcs/checkstyle.xml | |
--standard=TYPO3CMS | |
--extensions=php,inc | |
${env.WORKSPACE}/${env.JOB_NAME}" /> | |
</exec> | |
</target> | |
<target name="phpmd"> | |
<exec executable="phpmd"> | |
<arg line=" ${env.WORKSPACE}/${env.JOB_NAME} xml codesize,unusedcode,naming,design --reportfile ${env.WORKSPACE}/build/messdetector.xml --exclude Tests/" /> | |
</exec> | |
</target> | |
<target name="phpcpd"> | |
<exec executable="phpcpd"> | |
<arg line=" --log-pmd ${env.WORKSPACE}/build/phpcpd.xml ${env.WORKSPACE}/${env.JOB_NAME}" /> | |
</exec> | |
</target> | |
<target name="cleanup"> | |
<symlink action="delete" link="${env.WORKSPACE}/typo3_core/typo3conf/ext/${env.JOB_NAME}" /> | |
<delete dir="${env.WORKSPACE}/typo3_core"/> | |
</target> | |
</project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment