Task block type:
- Build publisher
- Email publisher
- Executable task
- File merge task
- Finalbuilder task
- Forcebuildpublisher
- Modification writer task
- Msbuild task
- Nant task
- Null task
- Nunit task
- Statistics publisher
- Visual Studio task
- XML log publisher
Tasks are executed sequentially. Here I only mention build publisher, nunit task, msbuild task, executable task, and email publisher.
1. Build publisher
How to publish after compilation is successful
< Buildpublisher >
< Sourcedir > C: \ myprojects \ project1 </ Sourcedir >
< Publishdir > \ Myfileserver \ project1 </ Publishdir >
< Uselabelsubdirectory > False </ Uselabelsubdirectory >
</ Buildpublisher >
Sourcedir: source file address
Publishdir: the address to publish.
<Uselabelsubdirectory>: whether or not each version creates a word directory based on the label Label and places the published content in it.
2. msbuild task
< Msbuild >
< Executable > C: \ windows \ Microsoft. NET \ framework \ v2.0.50727 \ msbuild.exe </ Executable >
< Workingdirectory > C: \ Dev \ ccnet </ Workingdirectory >
< Projectfile > Ccnet. sln </ Projectfile >
< Buildargs > /Noconsolelogger/P: configuration = debug/V: diag </ Buildargs >
< Targets > Build; Test </ Targets >
< Timeout > 15 </ Timeout >
< Logger > C: \ Program Files \ cruisecontrol. Net \ Server \ thoughtworks. cruisecontrol. msbuild. dll </ Logger >
</ Msbuild >
This does not need to be explained, but thoughtworks. cruisecontrol. msbuild. dll is a separate component, which I mentioned earlier
3. nunit task
Compile and run the test
< Tasks >
< Nunit > < Path > D: \ Dev \ ccnet \ tools \ nunit \ nunit-console.exe </ Path >
< Assemblies >
< Assembly > D: \ Dev \ refactoring \ bin \ debug \ refactoring.exe </ Assembly >
< Assembly > D: \ Dev \ refactoring \ bin \ debug \ refactoring. Core. dll </ Assembly >
</ Assemblies >
</ Nunit >
</ Tasks >
4. executable task
Execute oneProgram
Example 1: <exec executable = "C: \ projects \ myproject \ build. Bat"/>
Example 2:
< Exec >
< Executable > Make </ Executable >
< Basedirectory > D: \ Dev \ myproject </ Basedirectory >
< Buildargs > All </ Buildargs >
< Buildtimeoutseconds > 10 </ Buildtimeoutseconds >
</ Exec >
You can load any program you want to execute, such as fxcop.
5. Email publisher
Email Notification compilation report
< Email From = "Buildmaster@mycompany.com" Mailhost = "Smtp.mycompany.com"
Mailhostusername = "Smtpuser" Mailhostpassword = "Smtppassword" Includedetails = "True" >
< Users >
< User Name = "Buildguru" Group = "Buildmaster" Address = "Buildguru@mycompany.com" />
< User Name = "Joedeveloper" Group = "Developers" Address = "Joedeveloper@thoughtworks.com" />
</ Users >
< Groups >
< Group Name = "Developers" Notification = "Change" />
< Group Name = "Buildmaster" Notification = "Always" />
</ Groups >
</ Email >
Notification:
Always "-as long as compilation occurs
"Change"-the status of the compilation changes, from success to failure or failure to success.
"Failed"-compilation failed
"Success"-compiled successfully