Pro PHP- Patterns, Frameworks, Testing and More

(vip2019) #1
CHAPTER 8 ■ TESTING, DEPLOYMENT, AND CONTINUOUS INTEGRATION^119

> wget http://xinc.googlecode.com/files/xinc-1.0.tar.gz
> tar zxf xinc-1.0.tar.gz
> ./install.sh

The install program will ask you about your PHP environment and create installation
directories.
Next, Xinc needs a working directory for your project. I suggest /usr/local/www/projects/
myfirstrepo. Check out a copy of your repository there and execute phing try to ensure that
the project can be integrated properly.

Creating the Xinc Configuration File.


With Xinc installed, you next need to create the Xinc configuration file, config.xml, as shown in
Listing 8-7. Place this file in /etc/xinc.

Listing 8-7. A Xinc Configuration File (/etc/xinc/config.xml)

<?xml version="1.0"?>
<projects>
<project name="MyFirstXincProject" interval="60">
<modificationsets>
<svn directory="/usr/local/www/projects/myfirstrepo" />
</modificationsets>
<builder
type="phing"
buildfile="/usr/local/www/projects/myfirstrepo/build.xml"
workingdirectory="/usr/local/www/projects/myfirstrepo/"
target="try"
/>
<publishers>
<email
to="[email protected]"
subject="Build Failed"
message="Someone committed something that doesn't pass unit tests."
publishonfailure="true"
/>
</publishers>
</project>
</projects>

The configuration file is fairly self-explanatory. Each project is checked for changes at a
given interval—60 seconds in this case. Within the <project> element is a <modificationsets>
element, which refers to the files you want to watch for modification. This directory must be a
Subversion checkout and not the repository itself.
The <builder> element controls the execution of your Phing build script. In this example,
Phing is being automatically configured to publish the files with the try target. Xinc optionally
offers the ability to separate build and publication steps for the actual deployment, but with
your Phing build.xml, this functionality is not required.

McArthur_819-9C08.fm Page 119 Friday, February 22, 2008 9:06 AM

Free download pdf