views:

18

answers:

1

I'm rejigging our deploy scripts, and have moved to external config files for each defined environment. I have the ${environment} and the ${system} component passed as variables on the command line.

I load config.${environment}.xml, which contains a bunch of property definitions.

<property name="server.component1" value="server01" />
<property name="server.component2" value="server02" />
<property name="drive.component1" value="C:\" />
<property name="drive.component2" value="D:\" />
<property name="unc.component1" value="\\${server.component1}\Builds\${system}\${build.date}" />
<property name="unc.component2" value="\\${server.component2}\Builds\${system}\${build.date}" />

To determine the server to deploy to, I need to combine 'server' and ${system} and then evaluate as a property name. I'm missing something here.

<property name="server" value="${'server.' + system}" /><!-- TODO make this work -->
<property name="server" value="server.${system}" />
+1  A: 

The property::get-value function should be of some help:

<property name="server" value="${property::get-value('server.' + system)}" />
Peter Lillevold
Thankyou for this, just what I need
Luke M
@Luke M - you're welcome!
Peter Lillevold