3

我在 CruiseControl.NET(版本 1.4.4)中有多个项目,我已分配给一个队列......

   <project name="Build - A" queue="Q1">
   ...
   </project>
   <project name="Build - B" queue="Q1">
   ...
   </project>
   <project name="Build - C" queue="Q1">
   ...
   </project>
   <project name="Build - D" queue="Q1">
   ...
   </project>

所有项目都是非触发项目——我(与部门中的所有其他开发人员一起)使用 CCTray 手动启动每个项目。问题是:如果在项目 A 运行时,另一个用户使用 Force Build 启动另一个项目,它会与项目 A 同时运行。即使他们在同一个队列中。我会认为同一个队列中的请求会......我不知道,排队并且不会同时执行。我正在使用“UseFirst”的默认队列实现。

知道如何使队列中的项目表现得更像队列吗?我想将这些项目添加到一个定时调度程序中,但没有任何信心这些项目不会全部尝试同时运行并杀死我动力不足的构建机器,我不敢尝试。

4

2 回答 2

4

奇怪的。我正在使用您提到的相同配置并将强制构建请求排队。尝试更新 ccnet 版本。

以下是(部分)我的 ccnet 配置风格(它使用预处理器):

<cruisecontrol
    xmlns:cb="urn:ccnet.config.builder" xmlns="http://thoughtworks.org/ccnet/1/5">

  <!-- Queue to make sure one build at a time - to avoid same folder SVN locking issues-->
  <queue name="Q_Synchronizer" duplicates="UseFirst" />

  <!-- ************ Common defs (CC.net pre-processor tags)*********-->
  <cb:define local_svn_root="C:\svn"/>
  <cb:define remote_svn_root="http://SVN_SERVER:8888/svn/"/>
  <cb:define svn_exe="C:\Program Files\Subversion\bin\svn.exe"/>
  <cb:define svn_user="SVNUSER" svn_pw="PPPPPWWWW"/>
  <cb:define server_url="http://CCNET_SERVER/ccnet"/>
  <cb:define build_timeout="900"/>

  <cb:define name="msbuild_task">
    <msbuild>
      <executable>C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe</executable>
      <workingDirectory>$(local_svn_root)$(project_solution_path)</workingDirectory>
      <projectFile>$(project_solution_file)</projectFile>
      <buildArgs>/p:Configuration=$(project_solution_configuration) /p:VCBuildAdditionalOptions="/useenv" /v:diag /t:rebuild</buildArgs>
      <timeout>$(build_timeout)</timeout>
    </msbuild>
  </cb:define>

  <cb:define name="svn_dependency">
    <svn>
      <executable>$(svn_exe)</executable>
      <workingDirectory>$(local_svn_root)$(internal_svn_path)</workingDirectory>
      <trunkUrl>$(remote_svn_root)$(internal_svn_path)</trunkUrl>
      <username>$(svn_user)</username>
      <password>$(svn_pw)</password>
      <timeout units="minutes">30</timeout>
    </svn>

  </cb:define>

   <cb:define name="project_template" >
    <project name="$(project_name)" queue="Q_Synchronizer" queuePriority="$(queuePriority)">
      <workingDirectory>$(local_svn_root)$(project_solution_path)</workingDirectory>
      <webURL>$(server_url)/server/local/project/$(project_name)/ViewLatestBuildReport.aspx</webURL>
      <triggers>
        <intervalTrigger seconds="30" name="continuous" buildCondition="IfModificationExists"/>
      </triggers>
      <sourcecontrol type="multi">
        <sourceControls>
          <cb:svn_dependency internal_svn_path="$(project_internal_svn_path)"/>

          <cb:additional_svn_dependencies/>

        </sourceControls>
      </sourcecontrol>
      <tasks>
        <cb:msbuild_tasks/>
      </tasks>
      <publishers>
        <xmllogger logDir="$(local_svn_root)$(project_solution_path)\BuildLogs" />        
      </publishers>
    </project>
  </cb:define>

   <!-- ************* Projects definition ************-->
  <cb:project_template
     project_name="Proj A"
     project_internal_svn_path="/code/"
     project_solution_path="/code/Proj A"
     project_solution_file="Proj A.sln"
     queuePriority="1"
     >
    <cb:define name="msbuild_tasks">
      <cb:msbuild_task project_solution_configuration="Debug"/>
      <cb:msbuild_task project_solution_configuration="Release"/>
    </cb:define>
    <cb:define name="additional_svn_dependencies">
      <cb:svn_dependency internal_svn_path="/bin"/>
    </cb:define>

  </cb:project_template>

  <cb:project_template
     project_name="Proj B"
     project_internal_svn_path="/code/"
     project_solution_path="/code/Proj B"
     project_solution_file="Proj B.sln"
     queuePriority="1"
     >
    <cb:define name="msbuild_tasks">
      <cb:msbuild_task project_solution_configuration="Debug"/>
      <cb:msbuild_task project_solution_configuration="Release"/>
    </cb:define>
    <cb:define name="additional_svn_dependencies">
      <cb:svn_dependency internal_svn_path="/third-party"/>
    </cb:define>
  </cb:project_template>


</cruisecontrol>
于 2011-02-09T10:34:23.013 回答
0

您可以尝试在他自己的队列中定义每个项目,并将所有其他队列添加到lockqueues参数中(参见Queue Configuration的最后一个示例)

于 2011-02-07T16:00:50.117 回答