0

当我通过 iis 或 cctray 运行巡航控制时,我得到了执行,下面是 ccnet.config。我想通过巡航控制运行我的脚本。请让我知道如何解决这个问题

<project name="Visteon">
         <webURL>http://localhost/ccnet/</webURL>

        <triggers>
            <intervalTrigger seconds="110" buildCondition="ForceBuild" />
        </triggers>

        <tasks>
            <msbuild>
                <executable>C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
        </executable>
                <workingDirectory>E:\workingfolder_123</workingDirectory>        
                                <buildArgs>E:\CCnet.xml /p:Configuration=release</buildArgs>
                <timeout>1800</timeout>
                <!--  30 minutes -->
                <logger>C:\Program Files\CruiseControl.NET\server\
            ThoughtWorks.CruiseControl.MSBuild.dll</logger>
            </msbuild>
        </tasks>
    </project>

</cruisecontrol>   

我的脚本是这样的

<Target Name="GetSource">
    <Message Text="Checking out trunk into $(SourceDirectory)" />
    <SvnCheckout RepositoryPath="$(SvnCheckoutPath)"
        LocalPath="$(CheckOutPath)"
        UserName="aa"
        Password="aa">
      <Output TaskParameter="Revision" PropertyName="Revision" />
    </SvnCheckout>
  </Target>
  <Target Name="Build" DependsOnTargets="GetSource;Clean;" />
  <Target Name="Clean">
    <!-- Clean, then rebuild entire solution -->
    <MSBuild Projects="$(CheckOutPath)\SUPPLIER_SOFTWARE.sln" Targets="Clean;Rebuild" />
  </Target>
4

2 回答 2

1

尝试使用下面的 CruiseControl 模板

<project name="MyCodeFolder Project" queue="MyQueue" queuePriority="1">    
<tasks>
  <msbuild>
    <executable>C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</executable>
    <workingDirectory>D:\Projects\MyCodeFolder</workingDirectory>
    <projectFile>CCnet.xml</projectFile>
    <buildArgs>/noconsolelogger /nologo /p:Configuration=Release</buildArgs>
    <targets>
    </targets>
    <timeout>4800</timeout>
  </msbuild>
</tasks>   

至于构建脚本,您需要根目录才能拥有 Project 节点并将默认目标名称 main 设置为入口点。请看下面:

<Project DefaultTargets="Main">
     <Target Name="Main">
            //Do Something
     </Target> 
</Project>
于 2013-08-29T18:16:13.343 回答
0

您缺少项目文件标签,例如

<projectFile>your_msbuild_script-here</projectFile>

http://build.sharpdevelop.net/ccnet/doc/CCNET/MsBuild%20Task.html

我也不确定到底E:\CCnet.xml是什么。如果这是您的 msbuild 文件,请将其放入并重<projectFile/>试。

我希望这会有所帮助。

于 2013-07-02T03:51:56.443 回答