CHAPTER 20 ■ CONTINUOUS INTEGRATION
useful as the documentation is, it might give you the impression that you won’t be up and running with
a build and test cycle any time soon.
phpuc comes to the rescue, though, with the project command. This creates the required files and
directories, and amends any configuration files.
phpuc project --source-dir src \
--version-control svn \
--version-control-url file:///var/local/svn/userthing/trunk \
--test-dir test \
--test-case UserTests \
--test-file UserTests.php \
--coding-guideline Zend \
--project-name userthing \
/usr/local/cruisecontrol/
■Note If I were running CruiseControl on system remote from my version control repository, I’d also want to set
the user and password options.
Much of this should be self-explanatory. CruiseControl will need access to the userthing source, so,
through phpuc, I need to tell it I’m using Subversion, and provide it with the URL for the code. Then I tell
it where to find the tests, the coding standard I wish to apply. To set things up, phpUnderControl needs
to know where to find the cruisecontrol directory, so I provide the path. The output of the phpuc
project command gives you a good idea of the work that needs to be done in order to pass on this
information.
Performing project task.
- Creating project directory: projects/userthing
- Creating source directory: projects/userthing/source
- Creating build directory: projects/userthing/build
- Creating log directory: projects/userthing/build/logs
- Creating build file: projects/userthing/build.xml
- Creating backup of file: config.xml.orig
- Searching ant directory
- Modifying project file: config.xml
Performing checkout task. - Checking out project.
- Preparing config.xml file.
- Preparing build.xml checkout target.
Performing PhpDocumentor task. - Creating apidoc dir: project/userthing/build/api
- Modifying build file: project/userthing/build.xml
- Modifying config file: config.xml
Performing PHP_CodeSniffer task. - Modifying build file: project/userthing/build.xml
Performing PHPUnit task. - Creating coverage dir: project/userthing/build/coverage
- Modifying build file: project/userthing/build.xml
- Modifying config file: config.xml