There are tools that help us in this process of building and testing the application at frequent pre-defined intervals, such as Cruisecontrol, Hudson, Bamboo etc., Refer to this link for the feature matrix comparison of these Continuous Integration Tools.
As an example we shall look at Cruisecontrol which is a Java based, open source CI tool - released with BSD style licence.
How CruiseControl works
Developer checks work into version control
CC polls version control
CC triggers a build
CC captures logs and build artifacts
Examples: jar, war, javadoc, unit test report, code coverage report, code quality metrics
CC publishes results
Examples: send email, send instant message
We have a config.xml file through which we could configure the tool.
We would specify the version control information(such as CVS host and credentials), the project details, the scheduling information(such as when to build the app), where to log the builds and save the artifacts and whom to inform when the build completes etc., in this config file.
Since plugins are available for cruisecontrol there is a lot of options that we can configure in this config.xml file.
Here's a sample config.xml file:
<cruisecontrol>
<project name="connectfour">There is a cruisecontrol dashboard through which we can access the history of artifacts and build results and manage those.
<listeners>
<currentbuildstatuslistener file="logs/${project.name}/status.txt"/>
</listeners>
<bootstrappers>
<svnbootstrapper localWorkingCopy="projects/${project.name}" />
</bootstrappers>
<modificationset quietperiod="30">
<svn localWorkingCopy="projects/${project.name}"/>
</modificationset>
<schedule interval="300">
<ant anthome="apache-ant-1.7.0" buildfile="projects/${project.name}/build.xml"/>
</schedule>
<log>
<merge dir="projects/${project.name}/target/test-results"/>
</log>
<publishers>
<onsuccess>
<artifactspublisher dest="artifacts/${project.name}" file="projects/${project.name}/target/${project.name}.jar"/>
</onsuccess>
</publishers>
</project>
</cruisecontrol>
Here is a sample Dashboard of cruisecontrol.
No comments:
Post a Comment