How To Achieve Continuous Integration for PowerBuilder using CruiseControl

 

What is CruiseControl.NET

CruiseControl.NET (CCNet) consists of a suite of applications, but at its core is the CruiseControl.NET Server which is an automated integration server.

The Server automates the integration process by monitoring the team’s source control repository directly. Every time a developer commits a new set of modifications, the server will automatically launch an integration build to validate the changes. When the build is complete, the server notifies the developer whether the changes that they committed integrated successfully or not.

Key Features of CCNET:

 

The CCNet Server offers several key features:

  1. Integration with a variety of Source Control systems
  2. Integration with other external tools, such as NAnt and PowerBuilder IDE
  3. Can build multiple projects on one server
  4. Remote management and reporting

CruiseControl.NET Tools

The other applications in the CruiseControl.NET suite are:

Web Dashboard: A .NET web application that gives you a status and detailed view of the CruiseControl.NET projects and servers in your organisation.

 

       CCTray: A client System Tray application that enables you to see ‘at a glance’ the state of your   projects from any machine on your network.

Cruise Control .Net Configuration

  1. Open the Cruise Control.Net installation folder (C:\Program Files\ CruiseControl.NET\server)
  2. Under ’server’ folder you can found ‘ccnet.config’ file. Open config file in your favorite text editor. (Visual Studio is proffered)

<!–  The name of your project – this must be unique for any given CruiseControl.NET server  –>

  <project name=”Project_Name”>

 

<!–   give the working directory path here of your project on the CCNet installed server –>

    <workingDirectory> </workingDirectory>

 

<!–  give the URL of the CCNet to access from the browser     Ex: http://DVAP02/ccnet   –>

      <webURL> </webURL>

 

<!–  Enter interval value to reduce calls to SVN

means if you specify ‘5’ for this field until 5 secs CCNet server will not check SVN even if there is a modification in the source code.–>

 

<modificationDelaySeconds></modificationDelaySeconds>

 

<!–   Enter interval value to specify after how many seconds it will fire automatically whenever a modification in the SVN occurred i.e., when source modified and check in occurred –>

 

<triggers>

<intervalTrigger seconds=”300″ />

</triggers>

<!–

Node                 Description

 

project              ==  The project in the repository to be monitored. If the project contains a space, enclose the text in double quotes (“)

username         ==  SVN user ID that CCNet should use to authenticate  string

password          ==  Password for the SVN user ID  string

 

executable       ==  The location of SVN.EXE. If SVN is installed on the integration server, the location of SVN will be read from the registry and this element may be omitted.

autoGetSource    ==  Specifies whether the current version of the source should be retrieved from SVN

workingDirectory ==  The folder into which the source should be retrieved from SVN. If this folder does not exist, it will be automatically created.

cleanCopy        ==  Controls whether or not SVN gets a clean copy (overwrites modified files) when getting the latest source.    –>

 

<sourcecontrol type=”svn”>

<trunkUrl>http://<server domain name>.com/svn/Desktop_Apps/PB11.5/trunk/src/<app>/

</trunkUrl>

<executable>C:\CCNET\trunk\Build\tools\SlikSvn\bin\svn.exe</executable>

<username><username> </username>

<password><password></password>

<workingDirectory>C:\CCNET\trunk\src\<app>

</workingDirectory>

<autoGetSource>true</autoGetSource>

<cleanCopy>true</cleanCopy>

</sourcecontrol>

<!–  A set of Tasks to run as part of the build.

A failed task will fail the build and any subsequent tasks will not run. Tasks are run sequentially, in the order they appear in the configuration.  –>

 <tasks>

<!—- To build the application and deploy the executables Orcascr115.exe used as executable and .orca is the script file to be written for the application build and deploy.

–>

<exec>

<executable>orcascr115.exe</executable>

<baseDirectory>C:\CCNET\trunk</baseDirectory>

<buildArgs>C:\CCNET\trunk\build_<app>_full.orca

</buildArgs>

</exec>

 

<!—- After building the application to deploy the executables  using NAnt.exe  which expects a .build file inside that set of targets specified.–>

 

<nant>

<executable>C:\CCNET\trunk\build\tools\nant\nant.exe</executable>

<baseDirectory>C:\CCNET\trunk</baseDirectory>

<buildArgs>-D:app.dir=\src\<app></buildArgs>

<nologo>false</nologo>

<buildFile>deploy.build</buildFile>

<targetList>

<target>deploy_<app></target>

</targetList>

<buildTimeoutSeconds>1200</buildTimeoutSeconds>

 

</nant>

</tasks>

 

<!—- After building the application to deploy the executables  using NAnt.exe  which expects a .build file inside that set of targets specified. Each target tag specifies the deployment info which contains the pbds and exes and resource files. –>

 

<target name=”deploy_<app>” depends=”find-svninfo”>

<property name=”internet_deploy_beta.dir” value=”${bin.dir}\Internet\Release-Auto\” overwrite=”true” />

<echo message=’moving files to ${internet_deploy_beta.dir}’ />

<delete dir=”${internet_deploy_beta.dir}”  />

<copy todir=”${internet_deploy_beta.dir}” verbose=”TRUE”                              flatten=”true” >

<fileset>

<include name=”${src.dir}/<app>/**/*.exe” />

<include name=”${src.dir}/<app>/**/*.pbd” />

<include name=”${src.dir}/common/<app>/**/*.pbd” />

<include name=”${src.dir}/common/<app>/**/*.pbd” />

<include name=”${src.dir}/common/<app>/**/*.pbd” />

<include name=”${root.dir}/bin/<app>/*.dll” />

</fileset>

</copy>

<copy todir=”${<app>_deploy_beta.dir}/resource” verbose=”TRUE” flatten=”true” >

<fileset>

<include name=”${root.dir}/bin/<app>/resource/**/*” />

</fileset>

</copy>

</target>

<!–  A set of Tasks that are run after the build is complete.  These tasks are used primarily to clean up after the build and to publish and report on the build results.

 

All tasks in this section will always run regardless of whether previous tasks fail or the build is broken.   –>

 

    <publishers>

<merge>

<file>C:\CCNET\trunk\build_<app>.log</file>      </merge>

<xmllogger/>

</publishers>

 

</project>

 

</configuration>

 

 

 

Queues can be defined in one of two ways:

  1. Implicitly: When a queue is defined in a project element, a queue will be automatically created. This will have the default settings for a queue.
  2. Explicitly: This is when a queue element is added to the configuration. Note: projects still need to have the queue element, otherwise they will not be associated with the queue.

By default, projects belong to a queue with the same name as the project, so if no queue name is defined in the project, a queue will be implicitly defined with the same name as the project.

 

Queue Configuration Element

 

<cruisecontrol>

<queue name=”Q1″ duplicates=”UseFirst” />

<project name=”Proj_auto” queue=”Q1″ queuePriority=”1″>

</project>

</cruisecontrol>

 

Based on the queuePriority application build if we have multiple applications within same queue.

 

 How To-Configure Cruise Control Client ( CCTray)

 

 After Installation of Cruise Control Client in the client system following are the steps to be done

 

Step 1: Double click on ‘CC’ button on the system tray. (Or) right click on ‘CC’ button and select ‘Settings’.

 

Step 2: Click on ‘Add…’ button.

 

 

Step 3: Click on ‘Add Server’ Button.

 

Step 4: Type the sever name or IP address where Cruise Type ‘Server Name’ or ‘IP Address of the server’ where ccnet server is installed in place of ‘local host’ and click on ‘OK

 

 

Step 5: Select your Project(s) from the ‘Available Projects’ list and click on ‘OK’ button.

 

Step 6: Go for ‘General’ tab and check the ‘Show balloon notifications’ and also check ‘navigate to the web page of the first project on the list’ radio button and click on ‘OK’

 

CCTray Configuration is completed.

 

 

 

About pbgeeks 12 Articles

PBGeeks is a website for PowerBuilder Professionals to come together and explore the new features being released in PB. Participate in the Forum and exchange your thoughts with the other PB Gurus. Job seekers can find plenty of most recent jobs all around the world in the Jobs Listing section. Employers can post their job openings to be made available to the entire PB community.