views:

137

answers:

1

I'm new to CCNet...

I would like to customize CCNet web dashboard to add a checkbox next to "Force Build" button to indicate that particular build is for release or not.

Please let me know whether these kind of customization possible? If so, provide some tutorials or article links to start

+4  A: 

I think doing what you wnat would be a huge pain, because you would have to hide some CC.net projects (let's say, the debug ones) and still build them if the checkbox is checked. That would be awkward to access the project's page with history and logs. If you thought about editing the ccnet project configuration on the fly don't forget you would have to restart the service to get it up-to-date. Finally your modifications could be ok for the dashboard but it will cause problem with cctray.

What I would do instead is having two distinct projects, one building in debug mode and one in release. This would be a lot more easy and straightforward. For example you could have a debug project whose builds are triggered from the source control repository updates and a release one which is manually or nightly built.

EDIT
For two different projects, what I would do is a bloc with the common code (for Release and Debug) with two dynamic parameters (let's say Conf and OutPath). I would also write a third project which takes care of executing the db script, this third project would be triggered every successful build of the Release one. Proceeding like this will allow you to execute Debug/Release builds separately, executing the script separately (on a force build) and on every Release build, and finally validating the script (on every commit). It would look like this :

<cb:define name="MyProject-Block">
    <project name="MyProject - $(Conf)" queue="General" queuePriority="100">
        <workingDirectory>D:\MyProject</workingDirectory>
        <triggers>
            <intervalTrigger seconds="300"/>
        </triggers>
        <cb:state-block/>
        <cb:svn-block svnpath="MyProject"/>
        <tasks>
            <msbuild>
                <executable>C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe</executable>
                <workingDirectory>D:\MyProject</workingDirectory>
                <projectFile>MyProject.sln</projectFile>
                <buildArgs>/p:Configuration=$(Conf);OutputPath="$(OutPath)"</buildArgs>
                <targets>Clean;Build</targets>
                <timeout>600</timeout>
                <logger>F:\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MSBuild.dll</logger>
            </msbuild>
        </tasks>
        <publishers>
            <xmllogger/>
            <statistics />
            <modificationHistory onlyLogWhenChangesFound="true" />
            <cb:email-block/>
        </publishers>
    </project>
</cb:define>

<cb:MyProject-Block Conf="Debug" OuputPath="..\Compil\Debug" />
<cb:MyProject-Block Conf="Release" OuputPath="..\Compil\Release" />

<project name="MyProject. DbScript" queue="General" queuePriority="110">
    <workingDirectory>D:\MyProject\DB</workingDirectory>
    <triggers>
        <projectTrigger project=" MyProject - Release">
            <triggerStatus>Success</triggerStatus>
            <innerTrigger name="Eurosport.Business" type="intervalTrigger" seconds="60" buildCondition="ForceBuild" />
        </projectTrigger>
        <intervalTrigger seconds="300"/>
    </triggers>
    <cb:state-block/>
    <cb:svn-block svnpath="MyProject/DB"/>
    <tasks>
        <!-- Executing the script here -->
    </tasks>
    <publishers>
        <xmllogger/>
        <statistics />
        <modificationHistory onlyLogWhenChangesFound="true" />
        <cb:email-block/>
    </publishers>
</project>
Benjamin Baumann
@Benjamin Baumann - Thanks for the response. Actually, I would like to trigger a build task to script database of that particular project. Please let me know whether it is possible? or what will you do in this situation?
Sandy
You mean, you have a single database for both Debug and Release projects and you need to run a sql script when you build to match the correct configuration (Debug/Release)?
Benjamin Baumann
@Benjamin Baumann - I want to script and commit development db script, only if it going to release mode; rather than script it in each build...
Sandy
Edited with what I would do (if I understood you well).
Benjamin Baumann