We'll be setting it up step by step, so this will be a real step by step approach. The reason is you can see what the benefits are of the setups used in this document.
The first parts will seem overdone for users who used CCNet before, but it is intended for the real starters. Later parts contain tips/situations for people with the basic knowledge.
Typically a build system consists of 2 servers and X development machines, they can be on different physical machines, but they can also be hosted on 1 machine.
Or 1 physical machine with virtual machines on it, everything is possible
These 2 servers are :
° Build server : referenced as BuildServer
° Source Control server : referenced as SourceControl
For this example the setup will be on 1 machine, so everybody can follow this tutorial without having to maintain multiple PC's.
The easiest way to set things up is to respect the following installation order :
° windows
° IIS
° .Net framework
° Visual Studio
° extra tools (Nant, Testdriven.Net, NCover, ...)
Step 1 : Installing CCNet
Since it has an installer, it is in fact : setup, next, next, next, ...
Once this is done, you will have :
° a new folder in \Program Files : CruiseControl.Net
° a shortcut on the desktop : CruiseControl.Net
This shortcut will start the build server.
Step 2 : Folder structure
Make the following folders
Folder Name |
Purpose |
c:\Integration |
will contain the integration logs, artifacts, sources, ... |
c:\Repository |
will contain the repository of our source control |
c:\Projects |
will contain checked out sources to work with |
Step 3 : First basic CCNet project
This project is just for playing around a bit with cruisecontrol, without having to do any real coding.
We'll just use a batch file, and play a bit with that.
Make a subfolder in c:\projects, named Example01
Create a command script named 'test.cmd' with the following contents
If you run this script, you'll see all the environment variables of your machine.
Step 4 : Configuring the build server
Start the build service, (there is a desktop icon) you will see a command window wit the following :
[CCNet Server:DEBUG] The trace level is currently set to debug. This will cause CCNet to log at the most verbose level,
which is useful for setting up or debugging the server. Once your server is running smoothly, we recommend changing
this setting in C:\Program Files\CruiseControl.NET\server\ccnet.exe.config to a lower level.
[CCNet Server:INFO] Reading configuration file "C:\Program Files\CruiseControl.NET\server\ccnet.config"
[CCNet Server:INFO] No projects found
[CCNet Server:INFO] Registered channel: tcp
[CCNet Server:INFO] CruiseManager: Listening on url: tcp://192.168.131.72:21234/CruiseManager.rem
[CCNet Server:INFO] Starting CruiseControl.NET Server
Since there are no projects, we'll add one for this simple script. Leave the CCNet server running, it will pick up the changes to the config file after every save.
Modify CCNet.config, found in \program files\CruiseControl.Net\server
Enter the following text :
<cruisecontrol>
<project>
<name>SimpleExample</name>
<triggers />
<tasks>
<exec>
<executable>c:\projects\test.cmd</executable>
</exec>
</tasks>
</project>
</cruisecontrol>
You'll see that the command window of the server added the following lines.
[680:INFO] Configuration changed: Restarting CruiseControl.NET Server
[680:INFO] Reading configuration file "C:\Program Files\CruiseControl.NET\server\ccnet.config"
[SimpleExample:INFO] Starting integrator for project: SimpleExample
Now you can also browse to the dashboard,
open your browser and surf to http://localhost/ccnet
you will see the project : SimpleExample
Press the 'Force' button to force the build. Next press 'Refresh Status' to view the result.
You see that the build was successfull
Clicking on the project name 'SimpleExample' will show a page with project related information. From there on you can go to individual builds.
This shows how to set up a very basic project in CCNet, the next topic will cover :
° improving the project setup
° setting up source control monitoring
° getting information about builds