I am attempting to set up parameters only if it is a ForceBuild.  I
have the parameters working, including the dialog window etc.
However, I want to use this same config file for continuous
integration, in addition to a force build that asks the developer
Debug|Release and Deploy|OrNot.  How can I go about this?  I've pasted
the current ccnet file below.  Please keep in mind this is a work in
progress and will be separated and more generic upon completion.
Thanx, I appreciate your assistance in this matter.

Jeannie

<cruisecontrol xmlns:cb="urn:ccnet.config.builder">


<!-- Set up parameters, once we have all of the projects working, we
can set these in one place & pass them around for
     easier maintenance -->
<cb:define name="parameters-block">

        <!-- <target name="setUpParameters> -->
        <parameters>
                <selectParameter>
                        <name>buildConfiguration</name>
                        <display>Build Type</display>
                        <description>Do you want to generate a release build?</
description>
                        <allowedValues>
                                <value name="Release">Release</value>
                                <value name="Debug">Debug</value>
                        </allowedValues>
                        <default>Debug</default>
                        <required>false</required>
                </selectParameter>
                <selectParameter>
                        <name>Deploy</name>
                        <display>Deploy Build</display>
                        <description>Do you want to deploy this 
build?</description>
                        <allowedValues>
                                <value name="Yes">Yes</value>
                                <value name="No">No</value>
                        </allowedValues>
                        <default>No</default>
                        <required>false</required>
                </selectParameter>
        </parameters>
        <!-- </target> -->

</cb:define>

<!-- TODO - pass these in per project file in lieu of hard coding,
just put it in a scope block to
        pass it all the common stuff into one file & include it per project
        This is to stay here in this file.  Move "project pieces to other
files and use
        cb:include at the end to include them with this info for the
preprocessor Depending on size of this file
        could even pull these to a separate one.  Sets of projects for debug,
release ? -->

 <!-- The URL to the dashboard -->
 <cb:define webURL="http://localhost/ccnet/ViewProjectReport"/>

 <!-- Current location on svn server -->
 <cb:define trunkURL = "url is here" />

 <!-- Current working Directory -->
 <cb:define workingDirectory = "workingDirectory" />

 <!-- Artifact Directory -->
 <cb:define artifactDirectory = "artifactDirectory" />

 <!-- Project File Relative to the working directory-->
 <cb:define projectFile = ".sln" />

 <!-- Deployment Location -->
<cb:define deployLocation = "deployLocation " />

<!-- Source Control Information -->
<cb:define name="svn-block">
   <sourcecontrol type="svn" >
        <executable>c:\program files\subversion\bin\svn.exe</executable>
        <trunkUrl>$(trunkurl) </trunkUrl>
        <workingDirectory>$(workingDirectory)</workingDirectory>
        <username>uname</username>
        <password>pword</password>
        <autoGetSource>true</autoGetSource>
  </sourcecontrol>
</cb:define>

<!-- Common Labeller -->
<cb:define name="labeller-block">
        <labeller type="defaultlabeller">
                <prefix>aba</prefix>
                <incrementOnFailure>false</incrementOnFailure>
        </labeller>
</cb:define>


<!-- Common Triggers -->
<cb:define name="continuous-trigger-block">
        <triggers>
                <intervalTrigger name="continuous" seconds="600"
buildCondition="IfModificationExists"/>
                <!-- Use this when debugging as it will kick it off more
frequently - seconds="10" -->
        </triggers>
</cb:define>

<!-- Common MSBuild 3.5 Tasks -->
<cb:define name="MSBuild35-block">
         <msbuild>
                <executable>C:\Windows\Microsoft.NET\Framework
\v3.5\MSBuild.exe</executable>
                <workingDirectory>$(workingDirectory)</workingDirectory>

                <timeout>600</timeout>
                <projectFile>$(projectFile)</projectFile>
                <targets>Clean;Build</targets>

                <!-- Continuous Integration builds the configuration will be 
debug,
however
                     if a build is forced a parameter will be set to debug or
release -->
                <!-- <if test="${CCNetBuildCondition}=='ForceBuild'"> -->


                <buildArgs> /p:Configuration=$[buildConfiguration] /v:diag</
buildArgs>

                <!--/noconsolelogger <buildArgs>/p:Configuration=Debug /v:diag</
buildArgs> -->

                <logger>
                        ThoughtWorks.CruiseControl.MsBuild.XMLLogger,
                        C:\Program Files\CruiseControl.NET\server
\ThoughtWorks.CruiseControl.MsBuild.dll
                </logger>
          </msbuild>
</cb:define>


<!-- Run Tests -->
<!-- TO DO STILL NEED WORK ON TESTS FOR LOGGER, LOCATION AND
RELATIONAL PATH -->
<cb:define name="testing-block">
        <exec>
                <executable>C:\Program 
Files\Gallio\bin\Gallio.Echo.exe</executable>
                <buildArgs>/rnf:test-report /rt:Xml-Inline  /v:Verbose

C:\trunk\MVC\Public\TheAba.Tests\obj\Debug\TheAba.Tests.dll</
buildArgs>
        </exec>
</cb:define>


<!-- Merge Files - get test location fixed and give them relational
path -->
<cb:define name="mergeFiles-block">
  <merge>
        <files>

                 <file>$(artifactDirectory)\Reports\test-report.xml</file>
                 <file>msbuild-results.xml</file>
                 <file>nant-results.xml</file>
        </files>
  </merge>
</cb:define>

<cb:define name="loggers-block">
        <xmllogger>
            <logDir>$(artifactDirectory)\BuildLogs</logDir>
        </xmllogger>
        <modificationHistory  onlyLogWhenChangesFound="true" />
</cb:define>


<!-- clean up previous log files & result files -->
<cb:define name="cleanup-block">

        <artifactcleanup cleanUpMethod="KeepLastXBuilds" cleanUpValue="5" />

        <exec>
                <executable>cmd</executable>
                <buildArgs>/c if exist $(ArtifactDirectory)\msbuild-results.xml
                        del $(ArtifactDirectory)\msbuild-results.xml</buildArgs>

        </exec>
        <exec>
                <executable>$(windir)\system32\cmd</executable>
                <buildArgs>/c if exist 
$(ArtifactDirectory)\Reports\test-report.xml
                        del 
$(ArtifactDirectory)\Reports\test-report.xml</buildArgs>

        </exec>
        <exec>
                <executable>cmd</executable>
                <buildArgs>/c if exist $(ArtifactDirectory)\nant-results.xml
                        del $(ArtifactDirectory)\nant-results.xml</buildArgs>

        </exec>
        <!-- TODO determine strategy, delete msi file now or before next
release build -->

</cb:define>

<!-- stops web server IIS 7 if deploy is selected -->
<cb:define name="stopWAS-block">
        <exec>
                <executable>$(windir)\system32\cmd</executable>
                <buildArgs>net stop WAS -y</buildArgs>

        </exec>

</cb:define>

<!-- start web server IIS 7 if deploy is selected -->
<cb:define name="startWAS-block">
        <exec>
                <executable>$(windir)\system32\cmd</executable>
                <buildArgs>net start W3SVC </buildArgs>
        </exec>

</cb:define>

<cb:define name="NAnt-block">
        <nant>
                <executable>C:\Program Files\nant\bin\NAnt.exe</executable>
                <baseDirectory>$(workingDirectory)</baseDirectory>
                <nologo>True</nologo>
                <buildTimeoutSeconds>600</buildTimeoutSeconds>
                <buildFile>C:\Program 
Files\CruiseControl.NET\Scripts\Default.build</
buildFile>
                <buildArgs>-D:deploy=$[Deploy]</buildArgs>

                <targetList>
                        <!-- <if test="${CCNetBuildCondition}=='ForceBuild'"> 
-->
                         <if test="$[Deploy] == Yes">
                                <!-- <buildFile>C:\Program 
Files\CruiseControl.NET\Scripts
\aba.build</buildFile>  -->
                                 <target name="deploy" description="Deploys to 
the target server" /
>
                        </if>

                        <if test="$[Deploy] != Yes">
                                <target name="Empty" description="Empty target 
so there isn't a
deploy" />
                        </if>

                </targetList>
         </nant>

</cb:define>

<!-- this will eventually be for each project using common information
and passing in parms -->
<project name="aba">

    <cb:scope >

        <cb:parameters-block />
        <cb:svn-block/>
        <cb:labeller-block/>
        <cb:continuous-trigger-block/>

        <!-- assign appropriate setup locations -->
        <webURL>$(webURL)</webURL>
        <artifactDirectory>$(artifactDirectory)</artifactDirectory>
        <workingDirectory>$(artifactDirectory)</workingDirectory>
        <state type="state" directory="$(artifactDirectory)" />

        <tasks>
                <cb:MSBuild35-block />
                <!-- <cb:Testing-block /> -->
                <cb:NAnt-block />
        </tasks>

        <publishers>

                <cb:mergeFiles-block/>
                <cb:loggers-block/>
                <cb:cleanup-block/>

                <!-- TODO determine strategy for msi files if deploy is run -->
        </publishers>

   </cb:scope>

</project>

</cruisecontrol>

Reply via email to