CHAPTER 20 ■ CONTINUOUS INTEGRATION
Once again, this target consists primarily of a call to the exec task. First, though, I create a fileset
that matches the userthing package file (userthing-1.2.1.tgz), and I convert this to an expanded path
using a new task: pathconvert. Now I have something I can pass to the command invoked by exec which
is pear install. Because the output attribute is set in this exec element, a failure will be accessible as
before. Finally, I delete the package file. It’s important to clean this up, because I’m making an
assumption that there’s only one file in the directory that matches userthing*.tgz. If I let the old
package files remain in my src directory, I would likely suffer unexpected results when I next increment
the version number.
Summary
In this chapter I brought together many of the tools you have seen in previous chapters, and glued them
in place with CruiseControl. I demonstrated that this Continuous Integration server is well suited to PHP
projects thanks to phpUnderControl. I prepared a small project for CI, applying a range of tools
including PHPUnit (both for testing and code coverage), PHP_CodeSniffer, PHP_CodeBrowser,
phpDocumentor and Subversion. Then I set up CruiseControl with phpUnderControl and showed you
how to add a project to the system. I put the system through its paces and, finally, showed you how to
extend CruiseControl so that it can bug you with emails, and test both build and installation.