2

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

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

我的 CCNet.config 文件是这样的:

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

我的构建文件是这样的:

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

有人可以指导我吗?

4

4 回答 4

1

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

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

第 2 步:安装后,要启动并运行 webdashboard,请启动浏览器并键入。http://localhost/ccnet(这是安装时的默认虚拟目录。它指向构建服务器中的 $InstallFolder/webdashboard 文件夹。如果系统运行的是 IIS5 或 6,那么您将看到 CruiseControl.Net 页面,在 IIS7 中,抛出 500 错误。要解决此问题,请执行步骤 3,如果没有遇到问题,请执行步骤 4。

第三步:以管理员身份运行以下命令。注意:这里的 ccnet 是虚拟目录,指向系统中 webdashboard 的物理位置。

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

运行命令后,只需重新启动 iis 并浏览到http://localhost/ccnet。它应该显示 CruiseControl.Net 仪表板。

第四步:下一步是配置ccnet服务器。打开位于安装目录的“服务器”文件夹中的 ccnet.config 文件进行编辑。

项目部分:

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

源代码控制部分

就我而言,源代码控制是 StarTeam。需要设置各种属性,如登录凭据、项目等。

可执行文件:Star Team 命令行实用程序“stcmd.exe”的路径。

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

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

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

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

自动获取源:将此指定为“真”将允许 CruiseControl.Net 自动从 StarTeam 签出文件

fileHistoryRegEx:我必须更改 Date 正则表达式,因为我的区域设置配置为英语(印度),其中 DateTime 指定为 DD-MM-YYYY HH:MI:SS (IST)。我不得不改变它,因为在运行期间我得到了一个 Format invalid:System.DateTime 异常。

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

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

星队

MSBuild 部分

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

可执行文件:系统中“MsBuild.exe”文件的路径。

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

项目文件:需要构建的 .proj 文件或 .sln 文件。

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

目标:要采取的行动。在这里,我想在解决方案上完成“清洁”然后“构建”。

超时:如果碰巧调用构建失败,将显示错误消息的时间。

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

以下是 msbuild 配置块的完整列表。微软构建

微软构建

触发器部分

触发器部分指定必须调用项目构建的时间和条件。在测试的初始设置期间,将 buildCondition 设置为“ForceBuild”(强制构建),一旦测试完成,将其更改为“IfModificationExists”(仅在检测到修改时执行构建)。

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

触发器

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

希望这可以帮助。

于 2008-11-20T12:08:11.753 回答
0

如果可能的话,你有没有尝试过用 Starteam 来设置文化<culture>en-US</culture>

我在使用 Visual Source Safe 时遇到了同样的问题。唯一的问题是文化设置不正确。

干杯。

于 2009-02-07T12:30:26.393 回答
0

我并不感到惊讶,我使用过 Star Team 一次,我只能说,我不得不在那个存储库工具中习惯的垃圾水平在我的整个编程生涯中被 Source Safe 超越过......

不要使用 Star Team,如果我今天要开始一个大的新项目,我可能会使用 GIT ......

于 2008-11-22T01:13:22.560 回答
0

尝试这个:

  • 更改配置文件中的项目设置

<project>DEL_CA_ROBOTS\Tools\CCNet17Nov08</project>

  <project>Project_name\View_name</project>
   <path>StarteamFolderName</path>

例如,如果您的项目名称是DEL_CA_ROBOTS并且视图名称也是DEL_CA_ROBOTS ,则脚本应该类似于 ..

   <project>DEL_CA_ROBOTS\DEL_CA_ROBOTS</project>
   <path>Tools\CCNet17Nov08</path>

希望能帮助到你。

于 2008-11-26T09:36:22.417 回答