In your workaround, it seems like it is the adding of the dynamicValues
to the nant task that calls the appropriate target in my build script.
The target in my target list is independent of what gets called. For
example, if I change my nant task to:
<nant>
<executable>C:\Temp\NAnt\nant.exe</executable>
<baseDirectory>C:\Temp</baseDirectory>
<nologo>false</nologo>
<buildFile>C:\Temp\test.build</buildFile>
<targetList>
<target>prep</target>
<target>build</target>
</targetList>
<buildTimeoutSeconds>1200</buildTimeoutSeconds>
<dynamicValues>
<directValue>
<default>Dev</default>
<parameter>buildType</parameter>
<property>targetList[0]</property>
</directValue>
</dynamicValues>
</nant>
I still get the 'Dev' target called in my build script.
Anyway, my build can be thought of in three main steps: "preparing"
(svn tag/export), build, publish. It is really just the preparing and
publishing that vary based on build type. Since I have two different
processes that react to the selection of build type, I'd like to try and
keep the values generic ("Dev", "Integration", "Release").
What I am trying to do is either use the selection to call a target in
my build script that is generated based on the build type selected - in
the prep case, I would then have targets called 'prep.dev',
'prep.integration', and 'prep.release'. However I was not able to
create the target based on the selection.
Next I tried passing in the selected parameter as a buildArg:
<buildArgs>-D:build.type=$[buildType]</buildArgs>
In this case, I was trying to have a single target 'prep', and in the
target I could check the build.type property and vary the behavior based
on what is passed in.
I couldn't get this to work either.
It is reasonable to expect to use the selection parameter to be able to
either:
1) Call not a single target based on the value of the parameter,
but a target such as 'prep.$[buildType]' or
2) Use the value of the select parameter to pass as a buildArg to a
single target
Thanks,
Beth
From: [email protected] [mailto:[email protected]]
On Behalf Of Beth Hechanova
Sent: Wednesday, October 21, 2009 8:01 AM
To: [email protected]
Subject: [ccnet-user] Re: Dynamic Parameters in 1.5.0
Thank you - the workaround is passing the selected buildType to my build
script now.
Beth
This email and any files transmitted with it are confidential &
proprietary to Systems and Software Enterprises, Inc. (dba IMS). This
information is intended solely for the use of the individual or entity
to which it is addressed. Access or transmittal of the information
contained in this e-mail, in full or in part, to any other organization
or persons is not authorized.
From: [email protected] [mailto:[email protected]]
On Behalf Of Craig & Sammi Sutherland
Sent: Tuesday, October 20, 2009 7:37 PM
To: [email protected]
Subject: [ccnet-user] Re: Dynamic Parameters in 1.5.0
Hi Beth,
I've looked into this one for you - your syntax is correct, but there is
a bug in the code that loads the configuration L Internally targetList
is an array, and the configuration parser is not detecting this.
For the moment, there is a workaround - use the following configuration:
<nant>
<executable>C:\Temp\NAnt\nant.exe</executable>
<baseDirectory>C:\Temp</baseDirectory>
<nologo>false</nologo>
<buildFile>C:\Temp\test.build</buildFile>
<targetList>
<target>$[buildType|Dev]</target>
</targetList>
<buildTimeoutSeconds>1200</buildTimeoutSeconds>
<dynamicValues>
<directValue>
<default>Dev</default>
<parameter>buildType</parameter>
<property>targetList[0]</property>
</directValue>
</dynamicValues>
</nant>
And I'll see if I can fix the bug.
Craig
From: [email protected] [mailto:[email protected]]
On Behalf Of Beth Hechanova
Sent: Wednesday, 21 October 2009 11:57 a.m.
To: [email protected]
Subject: [ccnet-user] Dynamic Parameters in 1.5.0
I have been trying to get Dynamic Parameters to work all afternoon, but
have not yet been successful.
I am trying to follow the "Defining a Build Target" example in
http://confluence.public.thoughtworks.org/display/CCNET/Dynamic+Paramete
rs.
I have a SelectParameter defined in my ccnet.config file as follows:
<project name="IMSRma-Test">
<parameters>
<selectParameter name="buildType">
<description>The type of build to perform</description>
<allowedValues>
<value name="Development">Dev</value>
<value name="Integration">Integration</value>
<value name="Release">Release</value>
</allowedValues>
</selectParameter>
</parameters>
When I force a build on this project in the dashboard, I get a dropdown
with the three choices. That works fine. What I cannot seem to get is
passing the selected buildType to my build file.
Following the parameters definition in the ccnet.config file, I have my
triggers, sourcecontrol block, labeller block, and prebuild block.
Finally I have my nant task as follows:
<tasks>
<nant>
<executable>C:\Program Files\nant\bin\nant.exe</executable>
<baseDirectory>C:/BuildArea/IMSRma-Test</baseDirectory>
<nologo>false</nologo>
<buildFile>C:\Program
Files\CruiseControl.NET\server\config\cc_build_imsrma-test.xml</buildFil
e>
<targetList>
<target>$[buildType|Dev]</target>
</targetList>
<buildTimeoutSeconds>1200</buildTimeoutSeconds>
</nant>
</tasks>
In my build file (cc_build_imsrma-test.xml), I have defined targets
'Dev', 'Integration', and 'Release'.
When I force a build from the dashboard, it doesn't matter what I
select, the target initiated is always 'Dev'.
I have also tried removing the default 'Dev' target ($[buildType]) -
when I tried this, then no target gets called in my build script
(presumably b/c I don't have a default target defined).
Is there something else I am missing to get this to work?
I am using v1.5.0.6299 of cc.net, and the latest nighly build of NAnt
((Build 0.86.3412.0; nightly; 5/5/2009))
Thanks,
Beth
This email and any files transmitted with it are confidential &
proprietary to Systems and Software Enterprises, Inc. (dba IMS). This
information is intended solely for the use of the individual or entity
to which it is addressed. Access or transmittal of the information
contained in this e-mail, in full or in part, to any other organization
or persons is not authorized.
---------------------------------------------------------------------------
This email and any files transmitted with it are confidential & proprietary
to Systems and Software Enterprises, Inc. (dba IMS). This information is
intended solely for the use of the individual or entity to which it is
addressed. Access or transmittal of the information contained in this e-mail,
in full or in part, to any other organization or persons is not authorized.
---------------------------------------------------------------------------