Dashboard > CruiseControl > CruiseControlWithClearcaseDynamicView
CruiseControlWithClearcaseDynamicView Log In View a printable version of the current page.

Added by Roy Wright , last edited by Kevin A. Lee on Jan 29, 2006  (view change)
Labels: 
(None)

Howdy!

This is an overview of setting up CruiseControl to work with a Clearcase dynamic view on Windows.
A method for using labels and a dynamically generated config.spec is available at DynamicClearcaseConfigSpec.

Steps:

  1. Setup Clearcase Dynamic View
  2. Install Java SDK
  3. Install Ant
  4. Install Tomcat
  5. Install CruiseControl
  6. Install Java Service Wrapper

First a couple of definitions:

  • INSTALL_DIR is where CruiseControl will be installed
  • WORK_DIR is your working directory where your CruiseControl config.xml will be

Setup clearcase dynamic view

  • Use a config.spec that loads exactly what you want to build.

Install j2sdk

  • set JAVA_HOME to this directory
  • Note, currently a JDK 1.4.2 is still recommended for the reporting app.

Install lastest version of Ant

  • set environment ''ANT_OPTS=-Xms4m -Xmx128m''
  • set environment "ANT_HOME=d:\java\apache-ant-1.6.2"
  • add ANT_HOME\bin to path

Install Tomcat 4.x or 5.0.x

  • Note, Tomcat 5.0.28 is a good one, but don't go with 5.5 version yet as it requires JDK 1.5.x.

Install CruiseControl 2..x

  • Add INSTALL_DIR to path
  • Follow the steps in Getting Started With CruiseControl
  • Here are the XML files for a sample project where:
    • dynamic view tag = spitfire_view
    • dynamic view drive = M:\
    • VOB = \spitfire
    • java Ant build script = M:\spitfire_view\spitfire\java\build.xml
    • working directory = D:\build\cruisecontrol
    • CruiseControl config file = D:\build\cruisecontrol\config.xml
    • If you are confused and don't know what data to provide in those fields, refer to Simon Brown's entry on the topic
config.xml
<cruisecontrol>
	<project name="jspitfire" buildafterfailed="true">
		<bootstrappers>
			<currentbuildstatusbootstrapper file="d:\build\cruisecontrol\logs\spitfire\buildstatus.txt"/>
                        <clearcaseviewstrapper viewpath="M:\spitfire_view\spitfire" voblist="\spitfire"/>
		</bootstrappers>
		<modificationset requiremodification="true" quietperiod="600">
			<clearcase branch="spitfire-dev" viewpath="M:\spitfire_view\spitfire" recursive="true"/>
		</modificationset>
		<schedule interval="3600">
			<ant antscript="D:\java\apache-ant-1.6.2\bin\ant.bat"
                                uselogger="true"
                                usedebug="false"
                                buildfile="d:\build\cruisecontrol\build-spitfire.xml"
                                target="masterbuild"/>
		</schedule>
		<log dir="d:\build\cruisecontrol\logs\spitfire">
			<merge dir="M:\spitfire_view\spitfire\java\reports\tests"/>
			<merge dir="M:\spitfire_view\spitfire\java\reports\metrics"/>
		</log>
		<publishers>
			<currentbuildstatuspublisher file="d:\build\cruisecontrol\logs\spitfire\buildstatus.txt"/>
			<artifactspublisher dir="M:\spitfire_view\spitfire\java\reports" dest="d:\build\cruisecontrol\artifacts\spitfire"/>
			<htmlemail mailhost="smtp.your.domain" 
                                         returnaddress="dev-team@your.domain"
                                         buildresultsurl="http://build.machine:8080/cruisecontrol/buildresults/spitfire" 
                                         skipusers="true" 
                                         spamwhilebroken="true" 
                                         subjectprefix="Build:" 
                                         logdir="D:\build\cruisecontrol\logs\spitfire"
                                         xsldir="D:\java\cruisecontrol-2.1.6\reporting\jsp\xsl"
                                         css="D:\java\cruisecontrol-2.1.6\reporting\jsp\css\cruisecontrol.css">
				<always address="admin@your.domain"/>
			</htmlemail>
		</publishers>
		<labelincrementer defaultLabel="spitfire.1"/>
	</project>
</cruisecontrol>
  • and the delegating ant build script:
    build-spitfire.xml
    <project name="cruisecontrol driver for spitfire" default="masterbuild" basedir="d:\build\cruisecontrol">
    	<property name="view.root" value="M:\spitfire_view"/>
    	<property name="project.root" value="M:\spitfire_view\spitfire\java"/>
    	<property name="clearcase.log.dir" value="${basedir}\logs\clearcase"/>
    	<property name="clearcase.log" value="${basedir}\logs\clearcase\log.log"/>
    
    	<target name="masterbuild" depends="checkout,build">
    		<echo message="build-spitfire Target: masterbuild"/>
    	</target>
    
    	<target name="checkout" description="Update package from ClearCase">
    		<echo message="Clearcase dynamic views don't need anything special, so just clean the log directory."/>
    		<delete dir="${clearcase.log.dir}"/>
    		<mkdir dir="${clearcase.log.dir}"/>
    	</target>
    
    	<target name="build">
    		<echo message="build project: ${project.root}\.build.xml  Target: cleanbuild"/>
    		<ant dir="${project.root}" antfile="${project.root}\build.xml" target="cleanbuild"/>
    	</target>
    </project>
  • After building the reporting system, use Tomcat Manager page to upload cruisecontrol.war file to server.
  • Verify your installation by running the cruisecontrol.bat from your WORK_DIR.

Install Java Service Wrapper

  • copied wrapper's three batch files to INSTALL_DIR:
    • WRAPPER_HOME\src\bin\App.bat.in
    • WRAPPER_HOME\src\bin\InstallApp-NT.bat.in
    • WRAPPER_HOME\src\bin\UninstallApp-NT.bat.in
  • Rename the App to whatever you want to name the service (I used "Cruise"):
    • INSTALL_DIR\main\bin\Cruise.bat
    • INSTALL_DIR\main\bin\InstallCruise-NT.bat
    • INSTALL_DIR\main\bin\UninstallCruise-NT.bat
  • copy to INSTALL_DIR\main\lib
    • WRAPPER_HOME\lib\Wrapper.DLL
    • WRAPPER_HOME\lib\wrapper.jar
  • Create INSTALL_DIR\main\conf and place wrapper.conf file in it (see RunningCruiseControlAsaWindowsService).
    • You will need the following parameters:
      • wrapper.app.parameter.1=CruiseControl
      • wrapper.app.parameter.2=-configfile WORK_DIR/config.xml
      • wrapper.app.parameter.3=-port 8000
    • The port 8000 is necessary because reporting's controlpanel.jsp is hard-coded to use port 8000.
    • You will probably need the following additional parameters in your wrapper.conf file:
      • wrapper.ntservice.account
      • wrapper.ntservice.password
      • wrapper.working.dir
  • Verify by running Cruise batch file, location shouldn't matter
  • Examine INSTALL_DIR\main\logs\wrapper.log
  • Install service by running InstallCruise-NT
  • Start service using control panel's service
  • Uninstall service by running UninstallCruise-NT
    • Note, Uninstalling the service just marks it for deletion. A reboot is necessary to perform the deletion.
Powered by a free Atlassian Confluence Open Source Project / Non-profit License granted to ThoughtWorks, Inc.. Evaluate Confluence today.
Powered by Atlassian Confluence 2.7.1, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators