PHP Objects, Patterns and Practice (3rd edition)

(Barry) #1

CHAPTER 20 ■ CONTINUOUS INTEGRATION


Figure 20–5. phpUnderControl


Now that I have phpUnderControl in place, somehow I need to get CruiseControl to acquire and
build the userthing project.


Installing Your Project


I’m a coder. I love fiddling around with text editors. But, like many, I hate writing configuration files.
So I’m lucky that phpuc provides me with a tool to generate the directories and configuration for my
project.


■Note Remember I installed CruiseControl at /usr/local/cruisecontrol. All files and directories discussed in


this section are relative to that location.


If I were to add userthing to CruiseControl manually, I’d start by editing a configuration file called
config.xml, which can be found at the top level of the CruiseControl directory. In that file I’d tell
CruiseControl that it should recognize the project, as well as telling it about some key locations, the
build schedule. I’d set up some publishers that help to build reports.
Then I’d create a working directory called userthing within the projects directory. Probably the
most important file within the userthing project directory is named build.xml. You encountered files
with this name in Chapter 19. Phing is based on Ant, and Ant is the tool that CruiseControl uses to build
its projects and to run any assessment tools. The syntax for Ant and Phing build files is identical.
There’s quite a learning curve to setting up CruiseControl. There’s an excellent reference to the
config.xml file at http://cruisecontrol.sourceforge.net/main/configxml.html which documents 123
XML elements at the time of this writing. You’ll likely use it when you start to delve deeper into CI. As

Free download pdf