Ant scripts can be automatically scheduled using the Periodic Process Timer. See /cb/wiki/8797#section-Periodic+Process+Timer. This allows scheduled build, test and release process automation. NOTE: CodeBeamer Ant Integration and customizationFigure: Build System with ANT Task
Builds can be integrated into the Document Manager: build deliverables and test reports can be copied into the Document Manager's folders using the <CBRelease> task.
Starting a Maven Build from Ant
A Maven process can be started from Ant by adding a <taskdef> for Maven: it has the main Java class com.werken.forehead.Forehead. This is the class which is executed from the script $MAVEN_HOME/bin/mvn.bat when starting Maven from the command line. To start Maven with a <taskdef> in Ant, the Maven classes must be on the classpath.
In the following build.xml file is an Ant sample script that starts a Maven build on a Windows machine. The basedir is the location of the Maven project file.
Open the target project and click on the Builds tab pane;
Existing builds are listed;
To create a new build press the New button (or you can select an existing build and skip the following steps).
Define or edit the name for the new build in the Name text field and provide a description in the Description text area;
Give a description of the Build;
Edit the Ant Logging Level;
Select an item for the Ant Build File combo box. This combo box contains the Statistical Build entry as well as all the Apache Ant build files that are found on the source code repository (such as Subversion or CVS). In the Ant Build File all source code files with the .xml extension will be shown;
Edit the Ant Targets and Ant Properties properties. These will be passed directly to the Apache Ant at run time;
Select "Enabled" to allow Ant Builds or if required, disable the build in the Status property;
The Build Scheduler section can be used to configure when and how often the build should be executed. If Synchronization is selected, synchronization with the source code repository will be executed before the build script is started (thus the script will run on the latest source code);
The Build Notification Forums section can be used to specify the forums where notifications are to be sent in case of successful or erroneous builds;
In the Project Statistics and Metrics section, if the Update Project statistics and metrics after this build option is selected, project statistical and metrics information will be created after the build is finished. Please consider that this might be CPU intensive on the server side.
Remote Build- and Deploy Automation
This article describes an approach to implement automated build and deploy management. Although it shows the sample code in form of a Groovy script, the same principles apply to any programming language.