Continuous integration (continuous INTEGRATION,CI) is the process of continuously compiling, testing, inspecting, and deploying source code. In many continuous integration environments, this means that a new build is performed whenever code in the source control library changes. The benefits of CI are clear: Frequent assembly of software can greatly increase the likelihood of early detection of defects, which are not complex in the early stages and are easy to solve. This tutorial is the pursuit of code quality series of supporting articles. In this tutorial, Andrew Glover describes the basic aspects of continuous integration and explains how to set up the CI process with the best open source technology.
Before you start
Learn what this tutorial is about and how to get the most out of this tutorial.
About this tutorial
This tutorial discusses the basic questions of continuous integration: what is continuous integration, why it is needed, how it works, and the development steps in a CI environment. This tutorial explains how to set up a CI process to build a repeatable and reliable build process.
You will learn how to properly configure a CI server, have it query the SCM repository, and run the Ant build process when you detect modifications in the source code. Also learn how to run automated JUnit tests and how to perform software checks with PMD and FindBugs. Finally, experience how Hudson (an excellent CI server) notifies you when a problem occurs, and ultimately helps you build reliable software more quickly.
Goal
This tutorial uses Hudson, Ant, and Subversion as a framework to explain the basic concepts of continuous integration. As you complete this one-hour tutorial, you will understand the benefits of continuous integration and how to properly set up and configure Hudson, Ant, and Subversion. The resulting build process will run tests and software checks and report as soon as the error occurs.
Prerequisite
To get the most out of this tutorial, you should be familiar with Java™ development. This tutorial also assumes that you understand the value of building software with appropriate quality and are familiar with JUnit.
Software Requirements
The continuous integration environment requires an automated build tool, a code repository, and a CI server. To practice the code in this tutorial, you need to install the Java platform as well as Hudson 1.150, Ant 1.7, JUnit 3.8.1, and Subversion 1.4.x.
For this tutorial, the recommended system configuration is as follows:
A system that supports Sun JDK 1.5.0_09 (or later) or IBM Developer Kit for Java 1.5.0 SR3, at least MB of primary memory
Installing software components and samples requires at least 20MB of hard disk space
The instructions in the tutorial are based on the microsoft®windows® operating system. All of the tools in this tutorial can also be used on linux® and Unix® systems.
The core concept of continuous integration
The CI process often builds software components, and in many cases builds software components whenever code in the source repository (such as Subversion or ClearCase) changes. The advantage of CI is that often building software can ensure early problems (such as code defects) and avoid problems being discovered when the software development cycle is complicated.