ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From neubyr <neu...@gmail.com>
Subject load properties based on deployment environment
Date Tue, 22 Mar 2011 15:29:44 GMT
Hi,

I want to set some deployment specific string replacements in a
project. For example, the project contains values like
{{{
	connectionurl = "http://localhost"
	connectionport = "12345"
}}}

These values need to be changed based on deployment environment
($deployenv) - dev, qa, or prod. Right now I am using 'if' for setting
these properties, but I am wondering if I can use property and regex
tasks. For example define properties in a deploy.properties like:
{{{
	dev.connectionurl="http\://dev.example.com"
	dev.connectionport="12345"
	test.connectionurl="http\://test.example.com"
	test.connectionport="23456"
	prod.connectionurl="http\://prod.example.com"
	prod.connectionport="34567"
}}}
... and then replace values based on $deployenv.connectionurl and
$deployenv.connectionport.

Any pointers on doing this will be really helpful. Any alternative
approaches or suggestion would be helpful too.

--
thanks,
neubyr.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message