本文介绍了Cruise Control .Net服务器无法检测到在Starteam上所做的修改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Cruise Control .Net 1.4进行持续集成,并将其安装在Windows 2000桌面上。我有Nant 0.85用于构建。我的Source控件位于Borland Starteam 2005中。我安装了.Net 2003框架,用于创建VB.Net Windows应用程序。我已经安装了CCNet,并认为我的CCnet.config文件配置正确。

I'm using Cruise Control .Net 1.4 for Continuous integration and have installed it on my Windows 2000 desktop. I have Nant 0.85 for the Build. My Source control is in Borland Starteam 2005. I have the .Net 2003 framework installed which I use for creating VB.Net windows applications. I have installed CCNet and I think my CCnet.config file is configured correctly.

我面临的问题是,每当更改任何代码并签入Starteam时,所做的修改没有被CCNet服务器检测到,因此我无法基于修改触发我的构建。我必须依靠forcebuild。但是,对于我的项目,每1分钟使用一次forcebuild是不可接受的。我希望触发器基于修改。即一旦在Starteam中检测到更改,构建便会自动进行。

The problem that I face is that whenever I change any code and check in Starteam, the modifications are not getting detected by the CCNet server and so I cannot trigger my builds on the basis of modifications. I have to rely on forcebuild for that. But using forcebuild every 1 minute is not acceptable for my project. I want the trigger to be based on modifications. I.e. as soon as a change is detected on Starteam, the build should automatically take place.

我的CCNet.config文件是:

My CCNet.config file is this:



<workingDirectory>C:\Documents and Settings\uj0011637\Desktop\StarteamCruiseControl\CCNet17Nov08</workingDirectory>
<webURL>http://172.24.120.37/ccnet</webURL>

<triggers>
    <intervalTrigger name="continuous" seconds="120" buildCondition="ForceBuild" initialSeconds="120"/>
    </triggers>


<sourcecontrol type="starteam">
   <executable>C:\Program Files\Borland\StarTeam Cross-Platform Client 2005 R2\stcmd.exe</executable>
   <project>DEL_CA_ROBOTS\Tools\CCNet17Nov08</project>
   <username>600513221</username>
   <password>car0b0ts</password>
   <host>oscar.nat.bt.com</host>
   <port>51234</port>
   <autoGetSource>true</autoGetSource>
   <timeout units="minutes">10</timeout>
</sourcecontrol>


<tasks>
      <!-- Configure NAnt to compile the updated files -->c:\
    <nant>
    <executable>C:\Documents and Settings\uj0011637\Desktop\Cruise Control\nant\nant-0.85\bin\NAnt.exe</executable>
    <baseDirectory>C:\Documents and Settings\uj0011637\Desktop\StarteamCruiseControl\CCNet17Nov08</baseDirectory>
    <nologo>false</nologo>
    <buildFile>CCNet17Nov08.build</buildFile>
    <logger>NAnt.Core.XmlLogger</logger>
    <buildTimeoutSeconds>1200</buildTimeoutSeconds>
    </nant>
</tasks>


<!--Publishers will be done after the build has completed-->
 <publishers>
  <xmllogger>
    <logDir>C:\Documents and Settings\uj0011637\Desktop\StarteamCruiseControl\Log</logDir>
  </xmllogger>
 </publishers>

 <modificationDelaySeconds>10</modificationDelaySeconds>

我的构建文件是这样的:

And my build file is this:





<target name="clean" description="Delete all previously compiled binaries.">
    <delete>
        <fileset>





            <include name="**/bin/${project::get-name()}.dll" />
            <include name="**/obj/**" />
            <include name="**/*.user" />
        </fileset>
    </delete>
</target>





<target name="rebuild" dependsontarget="clean, build ">
<zip zipfile="${project::get-name()}.zip"  verbose="true">
    <fileset>
    <include name="**/bin/*.dll" />
    <include name="**/bin/*.exe" />
    </fileset>
    <fileset>
    <include name="*.aspx" />
    <include name="*.css" />
    <include name="*.config" />
    <include name="*.js" />
    <include name="*.asax" />
    <include name="**.txt" />
    <include name="**.vb" />
    <include name="**.vbproj" />
    <include name="**.user" />
    <include name="**.sln" />
    <include name="**.suo" />
    <include name="**.resx" />

    </fileset>
    <fileset prefix="SQL">
    <include name="*.sql" />
    </fileset>
</zip>



</target>

<target name="unit_test" description="Run unit tests.">

     <exec program="${nunit.dir}\nunit-console.exe" commandline="bin/${prjname}.exe /xml=${prjname}.xml /nologo" />

   </target>

    <target name="build.Console">

    <solution configuration="release" solutionfile="CCNet17Nov08.sln">

    </solution>

    <property name="expected.output" value="bin/${prjname}.exe"/>
    <fail unless="${file::exists(expected.output)}">Output file doesn't exist in ${expected.output}</fail>

</target>

有人可以指导我

推荐答案

我在理解将StarTeam作为Vista中的源控件安装和配置CruiseControl.Net的文档时遇到了挑战运行IIS 7的系统。最后,我成功设置了巡航控制功能。我正在列出使它工作的步骤。

I had challenges in understanding the documentation for installing and configuring CruiseControl.Net with StarTeam as the souce control in a Vista system running IIS 7. Finally I have successfully set up cruise control to work. I am listing the steps to get it working.

步骤1:从此处获取CruiseControl.Net的副本。运行安装程序。作为安装的一部分,安装程序将安装ccnet服务器和Webdashboard。

Step 1:Grab a copy of CruiseControl.Net from here. Run the setup. As a part of the install, the setup installs the ccnet server and a webdashboard.

步骤2:安装后,要启动并运行Webdashboard,请启动浏览器并类型。 (这是安装时的默认虚拟目录。它指向$ InstallFolder / webdashboard文件夹如果您的系统运行的是IIS5或6,则将在IIS7中看到一个CruiseControl.Net页面,抛出500错误要解决此问题,请继续执行步骤3,如果没有遇到任何问题,请继续转到第4步。

Step 2:Once installed, to get the webdashboard up and running, fire your browser and type. http://localhost/ccnet (this is the default virtual directory on install. This points to the $InstallFolder/webdashboard folder in your build server. If the system is running IIS5 or 6, then you will see a CruiseControl.Net page, in IIS7, an 500 error is thrown. To resolve this issue, proceed to Step 3, if no issue was encountered, proceed to Step 4.

第3步:以管理员身份运行followin命令注意:ccnet是指向系统中Webdashboard物理位置的虚拟目录。

Step 3:Run the followin command as an administrator. Note: Here ccnet is the virtual directory which points to the physical location of webdashboard in the system.

%SystemRoot%\system32\inetsrv\appcmd迁移配置默认网站/ ccnet

%SystemRoot%\system32\inetsrv\appcmd migrate config "Default Web Site/ccnet"

运行命令后,只需重新启动iis并浏览到。它应显示

Once the command is run, then just restart iis and browse to http://localhost/ccnet. It should show the CruiseControl.Net dashboard.

步骤4:下一步是配置ccnet服务器。打开ccnet.config文件位于安装目录的服务器文件夹中。

Step 4:Next step is to configure the ccnet server. Open the ccnet.config file located in the ’server’ folder of the install directory to edit.

项目部分:

定义项目部分。项目名称可以是任何标识符,不一定是您的项目名称。这将由CruiseControl.Net用来识别您的项目。

Define the project section. The project name can be any identifier not necessarily your project name. This will be used by CruiseControl.Net to recognize your project.

源代码管理部分

源控件是StarTeam。

In my case, the source control was StarTeam. Various properties like login credentials, project etc, are to be set.

Executable:Star Team命令行实用工具 stcmd.exe的路径。

Executable:Path to the ’stcmd.exe’ the Star Team command line utility.

项目:必须提取的Star Team中定义的项目名称。

Project:The name of the Project as defined in Star Team, that has to be extracted.

用户名,密码,主机,端口:Star Team Server连接设置。

UserName, Password, Host, Port:Star Team Server connection setttings.

Path:必须从StarTeam中提取文件的路径。示例:考虑StarTeam中的Project根文件夹为 Test。让项目和解决方案文件位于 Test\TestProject\MyProject层次结构中。要从此位置提取项目文件和解决方案,请为项目指定 Test,并为路径指定 TestProject\MyProject。

Path:Path from which files have to extracted from StarTeam. Example: Consider the Project root folder in StarTeam is "Test". Let the project and solution files lie in the hierarchy "Test\TestProject\MyProject". To pull the project files and solution from this location, specify "Test" for project and "TestProject\MyProject" for path.

覆盖文件夹工作目录:路径来自Star Team的文件将被检出以进行构建。如果未指定,则将使用StarTeam中指定的原始工作文件夹来提取文件。

Override Folder Working Directory:Path to which the files from Star Team are to be checked out for the build. If not specified, the original working folder specified in the StarTeam will be used to extract the files.

自动获取源:将其指定为 true将允许CruiseControl.Net自动从StarTeam中检出文件

Auto Get Source:Specifying this to ‘true’ will allow CruiseControl.Net to automatically check out files from StarTeam

fileHistoryRegEx:我必须对Date正则表达式进行更改,因为我的区域设置被配置为English(印度),其中DateTime指定为DD-MM-YYYY HH:MI:SS(IST)。我必须更改此设置,因为在运行过程中遇到了Format invalid:System.DateTime异常。

fileHistoryRegEx:I had to make a change to the Date regular expression, as my regional settings was configured to English(India), wherein DateTime is specified as DD-MM-YYYY HH:MI:SS (IST). I had to change this, since I got a Format invalid:System.DateTime exception during the run.

TimeOut:指定StarTeam轮询的超时时间。

TimeOut:Specify the timeout for StarTeam polling.

以下是starteam配置块的完整列表。
StarTeam

Following is the complete listing of the starteam configuration block.StarTeam

StarTeam

MSBuild部分

我将MsBuild用于构建任务。以下部分说明了获取CruiseControl.Net的MsBuild设置所涉及的属性。

I used MsBuild for the build task. Following section explains the properties involved to get the MsBuild setup for CruiseControl.Net.

Executable:系统中 MsBuild.exe文件的路径。

Executable:Path to the ‘MsBuild.exe’ file in the system.

工作目录:要生成的文件的位置。即,StarTeam提取需要构建的文件的位置。

Working Directory:Location of the files to be built. i.e., Location to where the StarTeam extracted the files that need to be built.

项目文件:.proj文件或.sln文件。

Project File:The .proj file or the .sln file that needs to be built.

Build Args:指定传递给msbuild.exe的其他参数。

Build Args:Specifies additional arguments passed to the msbuild.exe.

Targets:要执行的操作。在这里,我希望先进行清理,然后在解决方案上进行构建。

Targets:Actions to be done. Here I wanted Clean’ and then ‘Build’ done on the Solution.

Timeout:Time:在此之后,如果恰巧调用失败,将显示错误消息。

Timeout:Time after which error message will be displayed if there happens to be a failure to invoke the build.

Logger:将用于生成生成结果的记录器程序集的位置。

Logger:Location of the logger assembly that will be used to produce the build result.

是msbuild配置块的完整列表。
MS Build

Following is the complete listing of the msbuild configuration block.MS Build

MS Build

触发器部分

触发器部分指定必须调用项目构建的时间和条件。在用于测试的初始设置过程中,将buildCondition设置为 ForceBuild(强制构建),测试完成后,将其更改为 IfModificationExists(仅在检测到修改后才进行构建)。

Triggers section specifies the time and condition when the build of the project had to be invoked. During intital setup for testing, set the buildCondition to "ForceBuild" (forces a build), and once the testing is done, change it to "IfModificationExists"(does a build only when a modification is detected).

以下是触发器配置块的完整列表。
触发器

Following is the complete listing of the Triggers configuration block.Triggers

触发器

步骤5:运行服务器中的ccnet.exe应用程序'CruiseControl.Net安装位置的文件夹。该代码将从StarTeam拉到指定的位置,然后继续构建。构建的结果存储在$ InstallFolder\ProjectName\Artifacts\ms-build.xml文件中。

Step 5:Run the ccnet.exe application located in the ’server’ folder of the CruiseControl.Net install location. The code will be pulled from the StarTeam to the location specified and the build should proceed. The results of the build are stored in the $InstallFolder\ProjectName\Artifacts\ms-build.xml file.

希望这会有所帮助。

这篇关于Cruise Control .Net服务器无法检测到在Starteam上所做的修改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-16 12:17
查看更多