This is the first article in a series that I intend to be a step by step walkthrough of preparing for a new web project.
-
Part 1 is going to cover creating a continuous integration server using
CruiseControl.NET, and assumes that you already have a server setup with Windows Server and a Visual Source Safe Server.
-
Part 2 is going to cover setting up a client computer for running Visual Studio 2008 and integrating with CCNet and VSS
-
Part 3 is going to cover creating a sample web application with a deployment project and having this project run in our continuous integration environment
-
Part 4 will be adding the ASP.NET Membership Provider to our Web Application
-
Part 5 is going to cover using MVP Architecture to be able to unit test our web application
-
Part 6 will be using WiX to create a setup file
-
Finally part 7 will go over various tools and applications that really go hand-in-hand with CI. Tools will include FxCop, Simian, NCover, NDepend, and others.
We're going to start with a base install of Windows Server 2003 (2008 will work just fine as well), all all the latest updates from Microsoft.
-
Create a user "CruiseControl" with local administrative rights
-
Make sure that IIS is installed and running.
-
Create a shared directory called "Builds", and another directory called "vssroot"
-
Install the .NET Frameworks v2.0, v3.0, and v3.5
-
Install
WiX v3.0.3621 or greater
-
Install CruiseControl.NET v1.3
-
Optionally install
CCNetConfig a tool to edit CruiseControl.NET configuration files with a GUI
-
Install the Visual Source Safe 2005 client utilities
-
-
-
Run services.msc
-
Open the properties of the "CruiseControl.NET Server" service
-
Set the Startup type to Automatic
-
Under the Log On tab, select Log on as the CruiseControl user you created
Configuring the VSS Database: (more on this later)
-
Create a new VSS Database
-
Add a read/write user by the name cruisecontrol
-
The project should be layed out in the following manner:
-
$/
-
trunk
-
buildScript
-
cruise.build
-
source
-
project.sln
Configuring the project in CruiseControl.NET
- Open the CruiseControl.NET Config file located by default here: C:\Program Files\CruiseControl.NET\server\ccnet.config
- Insert the following project xml into the config file changing the fields in brackets to meet your needs:
<project name="[MyProjectName]">
<sourcecontrol type="vss">
<project>$/trunk</project>
<username>cruisecontrol</username>
<password>[CruiseControlUserPassword]</password>
<executable>[path to visual source safe]\SS.EXE</executable>
<ssdir>[ Path to VSS database .ini file ]\</ssdir>
<autoGetSource>True</autoGetSource>
<applyLabel>False</applyLabel>
<workingDirectory>c:\vssroot\[MyProjectName]\</workingDirectory>
<cleanCopy>True</cleanCopy>
</sourcecontrol>
<triggers>
<intervalTrigger seconds="60" />
</triggers>
<tasks>
<nant>
<executable>C:\Program Files\nant-0.85\bin\NAnt.exe</executable>
<baseDirectory>C:\vssroot\[MyProjectName]</baseDirectory>
<buildFile>C:\vssroot\[MyProjectName]\buildScript\cruise.build</buildFile>
<nologo>True</nologo>
<buildTimeoutSeconds>30</buildTimeoutSeconds>
<targetList>
<target>run</target>
</targetList>
</nant>
</tasks>
</project>
- All of the other scripts will be included in VSS and pulled automatically during a build.
[Added]
I had a couple questions about the proper way to install NAnt in our configuration. Basically there are three items you need in order to have a successful installation.
- Unzip the NAnt-0.85 folder into your program files directory under c:\Program File\NAnt-0.85
- Unzip NAnt-Contrib into the NAnt installation directory. The files will need to be in the following Locations:
\
bin\
lib\
net\
CollectionGen.dll
Interop.MsmMergeTypeLib.dll
Interop.StarTeam.dll
Interop.WindowsInstaller.dll
SourceSafe.Interop.dll
tasks\
net\
MSITaskErrors.mst
MSITaskTemplate.msi
MSMTaskErrors.mst
MSMTaskTemplate.msm
NAnt.Contrib.Tasks.dll
NAnt.Contrib.Tasks.pdb (not available for releases)
NAnt.Contrib.Tasks.xml
SLiNgshoT.Core.dll
SLiNgshoT.exe
Note: you might have to manually create the "tasks\net" and "lib\net" directories. (taken from NAnt Contrib Readme file)
3. Finally you'll need to modify the NAnt config file in order for it to handle working with VS2008, Palermo offers an excellent article on this:
Jeffrey Palermo's Explaination of the NAnt Upgrade to 3.5