PHP Objects, Patterns and Practice (3rd edition)

(Barry) #1
CHAPTER 20 ■ CONTINUOUS INTEGRATION

You can see that an error has occurred, but the details aren’t entirely clear. The error message just
tells me that the build failed. In fact if I hit the XML Log File link I'll eventually find the error, buried
under an avalanche of XML. There are a couple of ways I could make this error more obvious. One way
would be to influence the failure messages generated by Ant. Another is to use a publisher to create an
artifact directory.
Artifacts are arbitrary outputs that can be incorporated into CruiseControl interface. All the reports
you have seen so far this chapter are actually acquired from artifact directories. CruiseControl provides
the artifactspublisher element, which belongs in config.xml under a project’s publishers element.
You’ve already seen email, a sibling element from this section. artifactspublisher simply takes output
generated either during a build or by post processing, and moves it into the artifacts directory. So here I
add an artifactspublisher element to my config.xml directory.


<artifactspublisher dir="projects/${project.name}/build/builderror"
dest="artifacts/${project.name}"
subdirectory="builderror"/>


This copies the builderror directory from projects/userthing/build to
artifacts/userthing//builderror. Next time CruiseControl encounters a build error, I can
click on the Build Artifacts link you saw in Figure 20.10, and then click through artifact directory links
to arrive at the page you can see in Figure 20–11.


Figure 20–11. A simple artifact report


Now that I’ve set up a basic report for the make-package target, I can go ahead and do the same for
install-package. I’d better implement it at the same time.



dir="${basedir}/source/src/"
includes="userthing*.tgz" />

<exec executable="pear" dir="${basedir}/source/src"
failonerror="on"
output="${basedir}/build/builderror/index.txt">





Free download pdf