Olivier
Olivier

Reputation:

CruiseControl.NET : launch build on commit

I searched a lot but i didn't find a solution for my problem.

I use CruiseControl.NET (1.4.4). My project (in ccnet.config) load a repository from a cvs server to a local repository, and launch some executables (msbuild, NUnit...).

I use a trigger (Interval or Schedule Trigger), that launch regularly my project. But if my project has not been modified, it always launch all next tasks. And I would like to avoid it. So i want to launch my project only if a commit has been detected.

Is there any solution for it please?

Thanks

Olivier

Upvotes: 1

Views: 1805

Answers (4)

Pondidum
Pondidum

Reputation: 11637

Your trigger needs to specify IfModificationExists:

<intervalTrigger 
    name = "dave" 
    seconds = "30"   
    buildCondition = "IfModificationExists" />

Although buildCondition="IfModificationExists" is the default anyway, so as long as its not set to ForceBuild you should be fine.

EDIT:

The URL Trigger might be of some use to you. You can set your svn server to modify a page on commmit and the CC.Net checks the page to see if it has changed, thus not getting all the files.

Upvotes: 4

Olivier
Olivier

Reputation:

Thank you Anders Juul abd Andy for your quick answers.

By using the intervalTrigger with "IfModificationExists" build condition, the project must be loaded each time (it's logical ^^). But my project size is about 450Mo. So it's a little long. So my last question is : can we execute all builds and next tasks when a commit command has been detected? (without loading all files, in CruiseControl). I use TortoiseCVS (version 1.10.10). Maybe we can force CruiseControl project to be lauched after a commit?

Upvotes: -1

Jochen
Jochen

Reputation: 1488

Just use IntervalTrigger, like this:

<triggers>
    <intervalTrigger />
</triggers>

You can also add an modificationDelaySeconds, to wait for a number of seconds before starting the build after the last commit.

    <modificationDelaySeconds>30</modificationDelaySeconds>

Upvotes: 0

Anders Juul
Anders Juul

Reputation: 2614

I start my project as below, which ensures that the tasks get executed only if there are modifications.

Hope this helps,

Anders, Denmark

Edited: My code excerpt didn't make it to the page - I've tried to replace less-than, bigger-than with brackets.

[project name="SpilMerePool" queue="Q2" queuePriority="1"] [sourcecontrol type="svn"] [trunkUrl]https://ajf-ser1.ajf.local:8443/svn/SpilMerePool/trunk[/trunkUrl] [workingDirectory]c:\from_vc\SpilMerePool[/workingDirectory] [executable]C:\Program Files\VisualSVN Server\bin\svn.exe[/executable] [username]username[/username] [password]password[/password] [/sourcecontrol]

Upvotes: 0

Related Questions