Setup of the Continuous Integration Server

 

To setup a continuous integration build, use the ContinuousBuild.pl program found in the /client/bin installation directory.  This program will initiate builds by monitoring version control repositories to determine if files have been changed. If it is determined that files have changed, it will initiate a build running on the machine where the Continuous Integration process has been defined, most often the version control server.  The parameters that are required for the ContinuousBuild.pl script are Sleep Time and the Configuration file name. The following syntax is used for the ContinuousBuild.pl command:

 

perl –S ContinuousBuild.pl <seconds to sleep> <configuration file>

 

In the following example, the version control repository specified in the Configuration file would be checked every 10 seconds.  A build will be started if a change is found in the repository specified in the Configuration file.

 

perl –S ContinuousBuild.pl 10 c:\mojo\continuousbuild.cfg

 

The Configuration file has the following syntax, where the # symbol is a comment line:

 

Name=<Display Name for the SCM repository>

SCMCmd=<SCM Command used to determine file changes>

MD5ResultsFile=<Fully Qualified Path to store the MD5 Results in>

BuildCmd=<Command Used to start a build>

 

An example Configuration file named ContinuousBuild.cfg is provided below. Note that the # symbol must precede any comment line.

 

# IBM Rational ClearCase

Name=ClearCase Build on Dynamic View z:\metalworks_vob

SCMCmd=cleartool lshistory -r -nco z:\metalworks_vob

MD5ResultsFile=c:\openmake\continuousbuild\dynamic_view_m.txt

BuildCmd=perl -S RunBuildJob.pl z:\metalworks_vob "Metalworks Dev"

 

In the example above, a ClearCase Dynamic View that is mounted on z:\metalworks_vob would be monitored.  The cleartool lshistory –r –nco z:\metalworks_vob command will list the history for all files in the view.  This information is used to calculate the MD5, which is stored in the c:\openmake\continousbuild\dynamic_view_m.txt directory.  If the MD5 number of the current query of the SCM repository were different from the last one saved in the MD5 file, then the perl -S RunWorkFlow.pl z:\metalworks_vob "Metalworks Dev" build would be run.

 

Multiple version control repositories can be monitored by including multiple entries in the Configuration file. The ContinuousBuild.pl script runs as a foreground process and should be run when the build machine is started. 

 

The actual execution of your Workflow is initiated by the RunWorkflow.pl script. This script will execute the specified Workflow from the machine Build Directory and wait for the Workflow to complete before ending. The command syntax for this program is as follows:

 

perl –s RunWorkflow.pl <Build Directory> <Workflow>

 

To take the most advantage of Continuous Integration builds, it is recommended to power builds by Meister so that every build initiated through the Continuous Integration process is executed as an Incremental Build.

 

Note that there is no logic within the RunWorkflow.pl script to determine dynamically where omcmdline.jar is located. You must manually update the $OpenmakeHome variable in this script to <INSTALL DIR>\bin.