PHP Objects, Patterns and Practice (3rd edition)

(Barry) #1
CHAPTER 20 ■ CONTINUOUS INTEGRATION

sudo apt-get install sun-java6-jdk


Otherwise, you can get Java directly from http://www.java.com.
Once you’ve confirmed that you have java (the java website will tell you if you haven’t), you need to
acquire CruiseControl. You can download the latest version at
http://cruisecontrol.sourceforge.net/download.html. You should end up with an archive named
something like cruisecontrol-bin-2.8.3.zip. Now you can move the directory somewhere central, and
launch the CruiseControl script.


$ unzip cruisecontrol-bin-2.8.3.zip
$ mv cruisecontrol-bin-2.8.3 /usr/local/cruisecontrol


$ cd /usr/local/cruisecontrol/
$ export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk/
$ ./cruisecontrol.sh


Notice that export line. Like many Java applications CruiseControl needs to know where your java
executable resides. You can see where that is on my system. Your system may differ. You can try
something like


ls -al which java


or

locate javac | grep bin


to find the directory you should use for JAVA_HOME. The java and javac (that’s the java compiler)
binaries will usually be found in a directory named bin. You should include the parent directory, and not
bin itself, in JAVA_HOME.


■Note Once you’ve got your proof of concept up and running, you may want ensure that CruiseControl starts up


automatically when you boot your integration server. An excellent blog entry by Felix De Vliegher at


http://felix.phpbelgium.be/blog/2009/02/07/setting-up-phpundercontrol/ includes a start-up script for


CruiseControl.


If all goes well, you should see some text scroll by, but that’s about all. Once you’ve recovered from
the sense of anti-climax, you can really find out whether you’re ready to proceed by firing up your
browser and visiting http://localhost:8080/dashboard. You should see something like the screen in
Figure 20–4.

Free download pdf