user2459106
user2459106

Reputation: 61

how to run msbuild script through cruise control

I am getting execption when i am running cruise control by iis or cctray and below is ccnet.config.i wanted to run my scrip through cruise control .please let me know how to relove this issue

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

my scripts is like this

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

Upvotes: 0

Views: 1099

Answers (2)

otaku
otaku

Reputation: 964

Try using the CruiseControl Template below

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

As for the build script you will need the root to have Project node and set default target name main as the entry point. Please see below:

<Project DefaultTargets="Main">
     <Target Name="Main">
            //Do Something
     </Target> 
</Project>

Upvotes: 1

Biser C.
Biser C.

Reputation: 553

You are missing project file tag e.g.

<projectFile>your_msbuild_script-here</projectFile>

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

I'm also not sure what exactly E:\CCnet.xml is. If this is your msbuild file, put it inside <projectFile/> and try again.

I hope that helps.

Upvotes: 0

Related Questions