惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 叶小钗
云风的 BLOG
云风的 BLOG
G
Google Developers Blog
S
SegmentFault 最新的问题
罗磊的独立博客
Hugging Face - Blog
Hugging Face - Blog
美团技术团队
爱范儿
爱范儿
博客园 - 三生石上(FineUI控件)
H
Hackread – Cybersecurity News, Data Breaches, AI and More
D
DataBreaches.Net
F
Fortinet All Blogs
TaoSecurity Blog
TaoSecurity Blog
D
Docker
C
Cybersecurity and Infrastructure Security Agency CISA
K
Kaspersky official blog
宝玉的分享
宝玉的分享
腾讯CDC
Google Online Security Blog
Google Online Security Blog
Recorded Future
Recorded Future
T
The Exploit Database - CXSecurity.com
T
The Blog of Author Tim Ferriss
V
V2EX
S
Securelist
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
C
CERT Recently Published Vulnerability Notes
A
Arctic Wolf
Scott Helme
Scott Helme
L
LINUX DO - 热门话题
Y
Y Combinator Blog
P
Proofpoint News Feed
T
Tor Project blog
AWS News Blog
AWS News Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
The Last Watchdog
The Last Watchdog
博客园 - 聂微东
T
Threat Research - Cisco Blogs
B
Blog
Attack and Defense Labs
Attack and Defense Labs
L
Lohrmann on Cybersecurity
C
CXSECURITY Database RSS Feed - CXSecurity.com
阮一峰的网络日志
阮一峰的网络日志
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
IT之家
IT之家
N
News and Events Feed by Topic
博客园 - 司徒正美
H
Help Net Security
C
Cisco Blogs
C
Check Point Blog
S
Secure Thoughts

博客园 - chelsea

Performance Tuning Technique: Ultra-Fast ASP.Net 书摘 ASP.Net 备忘 On Extension Method: 扩展方法该如何使用 REST on ASP.Net MVC (and Future) IoC 问题域 Log 问题域 Validation 问题域 代码的物理组织 C#代码组织: project over folder C#泛型: 消除Visitor模式的循环依赖, 以及无聊的Accept方法 ORM问题域 Web开发问题域 向 Spring.Net 提交的建议被采纳并实现了 开源.Net中文分词组件 [导入]C# 备忘录 The C# Programming Language Notes II [导入]C++/CLI:被忽视的集成技术 DNN4 (DotNetNuke) 备忘录 The Programming Language Idioms
持续集成 .Net手册
chelsea · 2005-12-24 · via 博客园 - chelsea
 

持续集成 .Net手册

一、概念

Martin Fowler的文章:Continuous Integration  中文翻译:持续集成

二、工具

传统工具:VisualStudio.Net,VisualSourceSafe,Rational ClearCase

自动编译工具:NAntNAntContrib

回归测试工具:NUnit

代码检查工具:FxCop

持续集成工具:CruiseControl.Net

三、步骤

  • CruiseControl.Net监控远程版本控制系统的变化

  • 变化发生时CruiseControl.Net调用编译工具进行编译(NAnt或VisualStudio.Net)

  • 编译成功后调用NUnit进行回归测试

  • 编译成功后调用FxCop进行代码检查

  • 完毕后将编译结果、测试结果、代码检查结果发送至开发人员、主管经理,并发布至网站

    图示:

   

    所有这一切都是按照编制好的脚本自动进行的

四、实施示例

目前我们使用的是ClearCase

主控软件为CruiseControl.Net,其脚本文件为ccnet.config

  • 配置远程版本控制系统

- <sourcecontrol type="clearCase">

  <viewPath>D:\cc_view\USE_TECH_DEPT\Platform\Nucleus\2产品开发\2实现\Nucleus1.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>

  </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>

  • 配置报告形式

<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>

  • 其中CruiseControl.Net没有提供代码检查工具FxCop的支持,其文档建议使用NAnt的<exec>任务来调用FxCop,直到出现<fxcop>的Task,因此,需要配置NAnt的脚本文件:

- <target name="fxcop" depends="build">

  <exec program="D:\Program Files\Microsoft FxCop 1.30\fxcopcmd.exe" commandline="/p:Y:\nucleus.fxcop /o:Y:\nucleus.xml" failonerror="false" />

  </target>

五、几点提示

  • CruiseControl.Net会自动根据本地ClearCase的View监控远程VOB
  • 其实除了监控远程版本控制系统外其它的任务都可以由NAnt来完成,CCNet只负责监控变化并调用NAnt即可
  • 可以直接为CCNet配置VisualStudio.Net解决方案"<build type="devenv" solutionfile="D:\dev\MyProject\MyProject.sln" configuration="debug" /> ",但这样就无法配置FxCop了,至少目前如此;
  • ccnetservice.exe.config中有一句“<add key="ccnet.config" value="C:\Downloads\TestData\ccnet.config" /> ”应该是配置ccnet.config的路径,但现在好像不管用,还得将ccnet.config放在server目录下 
  • 最好避免中文路径,否则就需要手工为几个Xml格式的文件,如.csproj等加入编码方式“<?xml version="1.0" encoding="UTF-8" ?>,或者将中文路径映射为虚拟硬盘:“subst Y: "D:\cc_view\USE_TECH_DEPT\Platform\Nucleus\2产品开发\2实现\Nucleus1.0\Source"”
  • NUnit有VisualStudio.Net插件NUnitAddin,FxCop等亦可以配置为VisualStudio外部工具,推荐使用
  • 各种工具的安装、使用,在各自的文档里都非常详细,网上亦有无数资源

六、参考资料