ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <jakarta-...@ehatchersolutions.com>
Subject Re: Switch between environments
Date Mon, 10 Feb 2003 20:48:48 GMT
This is a broad question that could take a while to fully cover all the 
ways it could be done, and it really depends on where your information 
is being stored.  Here is one scheme:

Have a directory with properties files for each server-name, and one 
called dev.properties.  These properties files will contain properties 
for each of the settings you want to vary between configurations.  In 
your build file do this:

<property name="server" value="dev"/>
<property file="config/${server}.properties"/>

And in each of properties file you could have:

ldap.config=whatever

And then use ${ldap.config} in your build file wherever you needed it, 
perhaps on a filtered <copy> that replaced some tokens in files that 
need to be deployed.

How you control the server setting is another thing that will vary 
depending on your situation, but you could do this:

	ant -Dserver=production

And it would then read config/production.properties and use those 
instead of dev.

	Erik


On Monday, February 10, 2003, at 03:38  PM, White, Joshua A (CASD, IT) 
wrote:
> Hello All,
>
> When performing a build, is there any "best practice" ways of switching
> between environments (Meaning changing your environmental information 
> from
> development to test or test to production).
>
> For example, I have an application that connects to an ldap directory 
> and a
> database.  What is the easiest way for me to switch out this 
> application
> configuration information at build time so that my app will be 
> deployed with
> the correct information?
>
> Joshua
>
>
>
>
>
>
> This communication, including attachments, is for the exclusive use of
> addressee and may contain proprietary, confidential or privileged
> information. If you are not the intended recipient, any use, copying,
> disclosure, dissemination or distribution is strictly prohibited. If
> you are not the intended recipient, please notify the sender
> immediately by return email and delete this communication and destroy 
> all copies.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>


Mime
View raw message