The integration phase can reveal errors and incompatibilities of different parts of a project, made by each developer on the team.
Cruise Control is a continuous integration server, to automate the integration phase according to the succession of the following tasks:
- The recovery of files from the SCM (Source Code Management)
- Compilation of source code
- Creation of the application archive (Ear, Jar, War, ...)
- Deployment of archive
- Execution of tests (Junit)
- Result notification (mail, rss, ...)
We'll start by explaining what continuous integration is and then how to configure CruiseControl.
Continuous integration is a development/project management technique which involves the frequent integratation of the work of all the team members. Then, an automatic compilation process must be launched to check for any compilation errors of the project. Tests can also be launched!
Specifically, continuous integration is the process of automating compilations of the source code (including the latest changes made by different members of the team). Most continuous integration tools are able to perform the following action:
- Proceed to the integration of the code based on a defined period of time (every hour, for example).
- Update code from a source control.
- Compilation of source code.
- Launch unit tests.
- Automatic sending emails to people involved (the developper who made the error, will receive the mail).
- Sending a mail (report).
- Deployment on a test server.
- Creating statistics
In reality, most of the continuous integration servers based on ANT or MAVEN (or both), provide an almost infinite list of possible actions.
The benefits of continuous integration are undeniable, it verifies gradually work of the whole team, to detect errors much faster and ensuring the consistency of the application.
Of course, the use of a continuous integration server implies several constraints:
- The compilation should be automated (ANT, Maven, ...), no human intervention is needed to have a successful compilation.
- Regular commit of the source code must be made by the team
- Automatic testing must be launched (e.g JUnit, ANT or MAVEN)
- An official shall receive the reports and ensure that people receiving errors are correcting
To go further, read this excellent article by Martin Flower: http://www.martinfowler.com/articles/continuousIntegration.html
- Download Cruise Control at the following address: http://cruisecontrol.sourceforge.net/download.html.
- Note that it is necessary to check the presence of the JAVA_HOME environment variable, which points to the JDK directory.
- Then start Cruise control (via the Program Menu or via the .bat file) and everything works.
- Cruise control opens with a sample application.
- It will launch a default reporting application called 'Cruise Config', a dashboard, a JMX server, and everything accessible via a simple browser.
- First run the configuration application of Cruise Control (Cruise Config). It is a Java Webstart, which is very convenient as you can run it from different
computers on your Integration Server.
- Once the application is launched, you should see a blank pane.
- Go to Application -> Configure servers to monitor ... menu to configure the servers to monitor.
- Press the Add button to add a new server control.
- Enter the following information about the server you want to monitor.
- Server Name: You can assign an arbitrary name to your server. It will be displayed in the tab of the tracking window.
- Host Name: The name of the server on which is Cruise Control is installed
- RMI Port: The port number that was passed to the Cruise server via the --rmiport parameter.
- Monitor Time: The number of seconds to wait for updates.
You can set up one or more servers and press the OK button to complete the server configuration. The application will display a tab for each of them, with the current state of their projects.