Continuous integration. Net manual I. Concepts
Martin Fowler's article: continuous integration
Ii. Tools
Traditional tools: visualstudio. net, visualsourcesafe, rational clearcase
Automatic compilation tools: Nant and nantcontrib
Regression testing tool: nunit
Code Check Tool: fxcop
Continuous integration tool: cruisecontrol. net
Step 3
Cruisecontrol. Net monitors changes in the remote version control system
When the change occurs, cruisecontrol. Net calls the compilation tool for compilation (Nant or visualstudio. net)
Call nunit for regression testing after compilation is successful
Call fxcop to check the code after compilation is successful.
After compilation results, test results, and code check results are sent to developers and supervisors and published to the website.
Figure:
All of this is automatically performed according to the prepared script.
IV. Implementation example
Currently, we use clearcase.
The main control software is cruisecontrol. net, and its script file is ccnet. config.
-<Sourcecontrol type ="
Clearcase">
<Viewpath>
D:/cc_view/use_tech_dept/platform/nucleus/2 Product Development/2 Implementation/nucleus 1.0/source</Viewpath>
<Uselabel>
False</Uselabel>
</Sourcecontrol>
-<Build type ="
Nant">
<Executable>
F:/software/agile. Net/nant-0.85-nightly/bin/nant.exe</Executable>
<Basedirectory>
F:/software/agile. Net/nant-0.85-nightly/bin</Basedirectory>
<Buildfile>
Y:/nucleus. Build</Buildfile>
<Logger>
Nant. Core. xmllogger</Logger>
-<Targetlist>
<Target>
Build</Target>
<Target>
Fxcop</Target>
</Targetlist>
</Build>
-<Tasks>
-<Nunit>
<Path>
D:/program files/nunit 2.2/bin/nunit-console.exe</Path>
-<Assemblies>
<Assembly>
Y:/newpdobject/testnewpdobject/bin/debug/testnewpdobject.exe</Assembly>
</Assemblies>
</Nunit>
</Tasks>
- Configuration Report Form
<Publishers>
-<Xmllogger>
<Logdir>
../Web/log</Logdir>
-<Mergefiles>
<File>
Y:/nucleus. xml</File>
</Mergefiles>
</Xmllogger>
-<Email from ="
Ajaxchelsea@163.com"Mailhost ="
163. com"Includedetails ="
True">
<Projecturl>
Http ://
Ajaxchelsea/ccnetweb</Projecturl>
-<Users>
<User name ="
Buildguru"Group ="
Buildmaster"Address ="
Ajaxchelsea@163.com"/>
<User name ="
Chelsea"Group ="
Developers"Address ="
Chelsea@chelseafc.com"/>
<User name ="
Ajax"Group ="
Developers"Address ="
Ajax@ajaxfc.com"/>
</Users>
-<Groups>
<Group name ="
Developers"Notification ="
Always"/>
<Group name ="
Buildmaster"Notification ="
Always"/>
</Groups>
</Email>
</Publishers>
- Among them, cruisecontrol. net does not provide support for the code check tool fxcop. In this document, we recommend that you use the Nant <exec> task to call fxcop until the <fxcop> task appears. Therefore, configure the Nant script file:
-<Target name ="
Fxcop"Depends ="
Build">
<Exec program ="
D:/program files/Microsoft fxcop 1.30/fxcopcmd.exe"CommandLine ="
/P: Y:/nucleus us. fxcop/O: Y:/nucleus us. xml"Failonerror ="
False"/>
</Target>
5. Tips
- Cruisecontrol. Net automatically monitors remote vob based on the Local clearcase View
- In fact, all tasks except monitoring the remote version control system can be completed by Nant. ccnet only monitors changes and calls Nant.
- You can directly configure the Visual Studio. NET solution for ccnet "<build type ="Devenv"Solutionfile ="D:/dev/myproject. sln"Configuration ="Debug"/>", But fxcop cannot be configured, at least for the moment;
- The ccnetservice.exe. config clause "<add key ="Ccnet. config"Value ="C:/downloads/testdata/ccnet. config"/>" Should be the path for configuring ccnet. config, but now it seems that ccnet. config has to be put in the server directory.
- It is best to avoid Chinese paths. Otherwise, several files in XML format need to be manually added, such as. csproj. "<? XML version = "1.0" encoding = "UTF-8"?> ", Or map the Chinese path to a virtual hard disk:" subst y: "D:/cc_view/use_tech_dept/platform/synus/2 Product Development/2 Implementation/synus1.0/source ""
- Nunit has the visualstudio. Net plug-in nunitaddin, fxcop, etc. It can also be configured as a Visual Studio external tool. It is recommended to use
- The installation and use of various tools are detailed in their respective documents, and there are countless resources on the Internet
Vi. References
- Full introduction to dailybuild
- Draco. net
- Java manual for continuous integration