Tuesday, July 29, 2008

Continuous Integration Tool--CC.Net

TeamCity is good tool, the free version is enough for most small-medium projects.
Cruise Control.Net is absolutely free and open source tool. Actually, it is more hard to configure.
Fortunately, there is a sourceforge project can help you.
cc-config: http://cc-config.sourceforge.net/

PS, CC.Net http://cruisecontrol.sourceforge.net/

Understand TeamCity Work Flow

首先可以将TeamCity 看作一个专门Continuous Integration(CI)的Web Portal. TeamCity可以管理多个Build Agent, ,每个Build Agent可以认为是专门用来编译代码的机器. 当然Build Agent可以和TeamCity是同一台计算机. TeamCity为什么采用多个Build Agent这样的架构呢?

多个Build Agent的优点:
  1. 主要是考虑到Build代码的过程可能能长, 另外是我们可能又想加入Unit Test的功能, 尤其是Unit Test很多的情况下(或者commit source很频繁), 一台计算机显然不行.
  2. 我们可以将Unit Test按功能分类, 将他们分配到不同的Build Agent上.
  3. 我们也可以将Unit Test按工作量进行分配, 将他们分配到不同的Build Agent上. 这其实是Load Balance
  4. 提供Pre-Tested commit特性, 详见下文.

TeamCity的特点:
  1. TeamCity由Java开发的, 所以是跨平台的, 支持Java和.Net. 它采用Tomcat作为Web Server.
  2. TeamCity支持多种Build工具, Java方面, 你可以选用Ant, Maven, Idea等. .Net方面, 你可以用MSbuild, NAnt以及Visual Studio的Solution文件.
  3. Pre-Tested Commit(Delayed commit)方式: 应该说这是TeamCity杀手级的特性(killer feature). 相信我们都遇到过这样的情况, 有的程序员嫌跑所有的单元测试太费时间, 测试了部分Unit Test就将代码提交到VCS上(或者根本没有跑Unit Test). 结果很不幸, 那些没有测试的case结果却跑不通. 你不得不将代码rollback, 其过程之痛苦不用多言. TeamCity介绍了Pre-Tested提交这个特性, 可以彻底解决这个问题. 它是为IDE提供TeamCity的插件来触发这个过程. 详细流程见下文的TeamCity的一般工作流程.
TeamCity的一般工作流程是(Workflow_Diagram):
  1. Programmer在IDE中通过TeamCity的Pre-Tested commit将代码check in到VCS Server
  2. TeamCity根据其Trigger设置, 定时从VCS Server取代码, 然后将代码发送到Build Agent中. 指派Agent 去执行响应的Build和Unit Test 操作.
  3. Build Agent完成操作后, 将结果返回给TeamCity.
  4. 如果结果正确的话, 则将Code 真正提交到VCS.

Monday, July 28, 2008

Continuous Integration Tool--TeamCity

TeamCity is another famous Continuous Integrating Tool. It is much easier to configure than CC.Net because TeamCity is allowed to configure through Web UI. The latter one has too many xml files to configure.

Product Site http://www.jetbrains.com/teamcity/
Free Version License Including
  • 3 Build Agents at no additional cost
  • 20 User Accounts
  • 20 Build Configurations

More detail Info, View the following blogs,
  1. Our Build Config--TeamCity(http://blog.eleutian.com/2008/03/07/OurBuildConfigurations.aspx)
  2. CruiseControl.NET is dead. Long live Team City!(http://blog.eleutian.com/2007/12/22/CruiseControlNETIsDeadLongLiveTeamCity.aspx)
  3. Integration of NCover into Team City for Tech Head Brothers(http://weblogs.asp.net/lkempe/archive/2008/03/30/integration-of-ncover-into-team-city-for-tech-head-brothers.aspx)
  4. Continuous Integration Revisited(http://www.zorched.net/2006/08/10/continuous-integration-revisited/)

NDbUnit Framework

NDbUnit test is a good UnitTest framework if you are familiar with C#. But this project seems not active since 2006.
Home Page: http://qualitylabs.org/projects/ndbunit/

How to increase scalability--InfoQ article

http://www.infoq.com/articles/scalability-panel

Thursday, July 24, 2008

WSE-enabled web service to authenticate by user/password

WSE is short for web service enhancement.

WSE 1 user/password authentication
1. http://www.eggheadcafe.com/articles/20021227.asp
2.http://www.devx.com/security/Article/15634/1954
3. http://www.eggheadcafe.com/articles/20021231.asp ( X509 certification )

WSE 3
1. http://geeknotes.wordpress.com/2007/03/16/a-simple-wse-30-web-service-to-authorize-by-username-and-password/
2. http://blog.nerdbank.net/2006/03/wse3-and-aspnet-membership-provider.html

version control with TortoiseSVN without SVN Server

If you only have a limited number of users, and do not need remote access, you can use Tortoise without a subversion server. This makes set-up much easier.
Steps:
1. Install TortoiseSVN software
2. Open Windows Explorer.
3. Create a empty folder as your repository, this can be local or on network drive.
4. Right click the empty folder, and then click on "Create repository here".
5. Then you can use TortoiseSVN--Repository browser to manage your repository directory. Maybe you can add such directories.
-project_a
-trunk
-branches
-tags
6. After the first 5 steps. you can do any operations just like the repository on a SVN Server.

How to arrange the svn repository layout

怎样组织svn的目录其实非常有学问,比如我们是要将多个项目放在一个svn repository下, 还是为每个项目都建立一个独立的svn repository呢? 实际上, 这两种做法各有优缺点. 

使用单一svn repository的优点是:只需要维护一个svn库,工作量自然会少了很多, 这里维护工作包括routinely backup,dump以及升级svn软件. 当然缺点也很明显: 一个项目的开发人员可以访问另一个项目的文件,另外一个严重的缺点是,每个项目的commit email list很可能不同, 但如果在一个repository下,就不能为不同的项目配置不同的email list, 这样一旦项目A被commit,项目B的也会收到commit email. 

下面是一个多项目的repository结构, 但项目的repository也可参照这个.

要说明的是trunk,branches和tags的意义, trunk里面维护着是项目的主要开发版本. branches是trunk版本的各类分支版本.tags是保存着trunk和branches的某一时刻的快照. 

/
calc/
trunk/
tags/
branches/
calendar/
trunk/
tags/
branches/
spreadsheet/
trunk/
tags/
branches/