Reputation: 1427
Dear omniscient stackoverflow ninjas, I need your help!
I have a CruiseControl.NET project that builds C# solution and executes some scripts. It builds project every time I make a commit with "Debug" MSBuild configuration.
What I need is to make CC to build my project with "Debug 2" configuration, when I do a force build, but it should remain using "Debug" configuration when building on git commit.
Is it possible to make such dynamic configuration? If yes, how should I do it?
Upvotes: 1
Views: 479
Reputation: 1674
Use ccnet parameters;
http://cruisecontrolnet.org/projects/ccnet/wiki/Parameters
For example:
<booleanParameter>
<name>Configuration</name>
<true name="Debug2">Yes</true>
<false name="Debug">No</false>
<display>Configuration</display>
<description>Do you want to build Debug 2?</description>
<default>Debug</default>
<required>false</required>
</booleanParameter>
Using it:
<tasks>
<nant>
<executable>nant.exe</executable>
<buildArgs>-D:config=$[Configuration|Debug]</buildArgs>
...
</nant>
</tasks>
config gets passed to Nant as a property.
Upvotes: 1
Reputation: 741
Another option was to check for the build condition in your build script. build script could be nant, msbuild, batch, .... These languages generally give more options for if, while, ... constructs than the ccnet.config file itself.
This keeps the ccnet.config more clean, and all the magic happens in the build script. It makes it also easier to test for changes without affecting the build server.
Look at the properties being passed to them :
http://www.cruisecontrolnet.org/projects/ccnet/wiki/Integration_Properties
Upvotes: 0
Reputation: 1427
Ok, I've found conditions in CC documentation.
<conditional>
<conditions>
<buildCondition>
<value>ForceBuild</value>
</buildCondition>
</conditions>
<tasks>
<!-- Tasks to perform if condition passed -->
</tasks>
<elseTasks>
<!-- Tasks to perform if condition failed -->
</elseTasks>
</conditional>
Upvotes: 0