In case anyone finds this thread looking for an answer, I think the
problem was that the Conditional plugin doesn't support dynamic
parameters (task doesn't "expose a dynamicValues element", see
http://ccnetlive.thoughtworks.com/ccnet/doc/CCNET/Dynamic%20Parameters.html),
so dynamic parameters don't work with it. (The new conditional
functionality in 1.6 likely supports this feature.) If you need to use
the Conditional plugin with CC.NET 1.5 -and- you want dynamic
parameters, you might try this workaround:
1- Get Conditional plugin source from codeplex
2- Modify ConditionalTask.cs [see below]
3- Re-build plugin
It seems like you could change ConditionalTask to inherit from
TaskBase (in Thoughtworks.CruiseControl.Core.Tasks) instead of ITask,
then refactor the current Run() method so that it matches the TaskBase
Execute() method signature instead (including ending with a "return
true" or whatever), and this would solve the problem. (TaskBase seems
to give you the dynamicValues thing for free, though maybe it brings
along other stuff you don't want... I guess maybe you could also just
modify ConditionalTask and find a task that uses dynamicValues as an
example.)
Though, I'm not associated with the CC.NET project or the conditional
plugin (I'm just a user) -- does anyone with more experience see any
problems with this suggestion, or have any caveats about using
TaskBase ("it's not intended for 3rd party plugins!")?
-Jennifer
On Apr 16, 9:11 am, andrew <[email protected]> wrote:
> We are running two basic types of builds: Normal and Nightly "Big"
> builds. Normal builds on changes to the depot; and doesn't build some
> of the really big projects we have. Nightly builds everything; and so
> we restrict that to run once a day; starting at 1am.
>
> Our trigger has this block:
> <parameterTrigger>
> <trigger type="scheduleTrigger" time="01:00"
> buildCondition="ForceBuild" name="Nightly post-scorch build" />
> <parameters>
> <namedValue name="isNightlyBuild" value="yes"/
>
> </parameters>
> </parameterTrigger>
>
> We also want users, when forcing a build, to have the option of
> running a nightly build as well; so we areusingparameters for that.
> Our project definition has this block:
>
> <parameters>
> <selectParameter>
> <name>isNightlyBuild</name>
> <allowedValues>
> <value name="Nightly Big-Build">yes</value>
> <value name="Normal Build">no</value>
> </allowedValues>
> <display>Nightly BIG Build?</display>
> <description>removed for brevity...</description>
> <default>Normal Build</default>
> <required>false</required>
> </selectParameter>
> </parameters>
>
> To scope what is/is not built we installed theConditionalplugin.
>
> To test what is happening we added this line to the top of our tasks
> block:
> <!-- Output the build type to the log -->
> <conditionaldescription="Log state of isNightlyBuild
> flag">
> <conditions>
> <compareCondition value1="$[isNightlyBuild]"
> value2="yes" evaluation="equal" ignoreCase="true"/>
> </conditions>
> <tasks>
> <commentTask message="isNightlybuild is true"/
>
> </tasks>
> <elseTasks>
> <commentTask message="isNightlybuild is false"/
>
> </elseTasks>
> </conditional>
>
> The problem is that if you start the build with a force, and set
> isNightlyBuild to Yes; it works (logs as you would expect); but the
> NIGHTLY trigger at 1am does not seem to set this flag correctly.
>
> Any suggestions?
>
> Thanks
> Andrew
>
> --
> Subscription
> settings:http://groups.google.com/group/ccnet-user/subscribe?hl=en