Info | HTML | Text

Documentation - Command line

Command Line Interface

The phpUnderControl package comes with a set of cli commands that aim to provide an easy way to work with CruiseControl. In the following sections you will find detailed descriptions for each command. All examples expect that you have changed your current working dir to the phpUnderControl/bin directory.

The Install/Update Command

To patch your CruiseControl installation you must execute the install command. Even if the name of this command is install, this command can be used to perform an update on an existing installation.

[ bin]$ ./phpuc install /opt/cruisecontrol Performing CruiseControl task. Performing modify file task. 1. Modifying file "/index.jsp". 2. Modifying file "/main.jsp". 3. Modifying file "/metrics.jsp". 4. Modifying file "/xsl/buildresults.xsl". 5. Modifying file "/xsl/errors.xsl". 6. Modifying file "/xsl/header.xsl". 7. Modifying file "/xsl/modifications.xsl". Performing create file task. 1. Creating file "/footer.jsp". 2. Creating file "/header.jsp". 3. Creating file "/phpcs.jsp". 4. Creating file "/phpunit.jsp". 5. Creating file "/phpunit-pmd.jsp". 6. Creating file "/css/php-under-control.css". 7. Creating file "/css/SyntaxHighlighter.css". 8. Creating file "/images/php-under-control/error.png". 9. Creating file "/images/php-under-control/failed.png". 10. Creating file "/images/php-under-control/header-center.png". 11. Creating file "/images/php-under-control/header-left-logo.png". 12. Creating file "/images/php-under-control/info.png". 13. Creating file "/images/php-under-control/skipped.png". 14. Creating file "/images/php-under-control/success.png". 15. Creating file "/images/php-under-control/tab-active.png". 16. Creating file "/images/php-under-control/tab-inactive.png". 17. Creating file "/images/php-under-control/warning.png". 18. Creating file "/js/shBrushPhp.js". 19. Creating file "/js/shCore.js". 20. Creating file "/xsl/phpcs.xsl". 21. Creating file "/xsl/phpcs-details.xsl". 22. Creating file "/xsl/phpdoc.xsl". 23. Creating file "/xsl/phphelper.xsl". 24. Creating file "/xsl/phpunit.xsl". 25. Creating file "/xsl/phpunit-details.xsl". 26. Creating file "/xsl/phpunit-pmd.xsl". 27. Creating file "/xsl/phpunit-pmd-details.xsl".

The Example Command

For a quick start with CruiseControl, phpUnderControl comes with a small example project. Just enter "phpuc.php example /path/to/cruisecontrol".

[ bin]$ ./phpuc.php example /opt/cruisecontrol Performing project task. 1. Creating project directory: projects/php-under-control 2. Creating source directory: projects/php-under-control/source 3. Creating build directory: projects/php-under-control/build 4. Creating log directory: projects/php-under-control/build/logs 5. Creating build file: projects/php-under-control/build.xml 6. Creating backup of file: config.xml.orig 7. Searching ant directory 8. Modifying project file: config.xml Performing example task. 1. Creating source directory: project/php-under-control/source/src 2. Creating tests directory: project/php-under-control/source/tests 3. Creating source class: project/php-under-control/source/src/Math.php 4. Creating test class: project/php-under-control/source/tests/MathTest.php 5. Modifying config file: config.xml Performing PhpDocumentor task. 1. Creating api documentation dir: project/php-under-control/build/api 2. Modifying build file: project/php-under-control/build.xml 3. Modifying config file: config.xml Performing PHP_CodeSniffer task. 1. Modifying build file: project/php-under-control/build.xml Performing PHPUnit task. 1. Creating coverage dir: project/php-under-control/build/coverage 2. Modifying build file: project/php-under-control/build.xml 3. Modifying config file: config.xml

The Clean Command

This command provides a simple way to remove old project log files and build artifacts. Just type "phpuc.php clean -j <project> -k 10 /path/to/cruisecontrol" to keep the last ten builds.

[ bin]$ ./phpuc.php clean -j <project> -k 10 /path/to/cruisecontrol

Or you can define the maximum age of the project logs and build artifacts with. The following command will keep everything that is young than ten days.

[ bin]$ ./phpuc.php clean -j <project> -d 10 /path/to/cruisecontrol