Re: Question: Best practice for switching db connections as build time
Re: Question: Best practice for switching db connections as build time
- Subject: Re: Question: Best practice for switching db connections as build time
- From: Randy Wigginton <email@hidden>
- Date: Mon, 3 Nov 2008 05:52:06 -0800
Late to the party here, but most CM & QA groups will not like this
approach. Also, SOX groups frown on this practice; it means that all
production passwords are in files in the source repository.
In general, this should be done with a property file (or other)
deployed separately from the rest of the code. This allows the CM
team to roll the latest code, which will automatically pick up the
correct production passwords.
If you don't have security considerations, then none of my comments
apply.
On Oct 31, 2008, at 12:17 PM, Miguel Arroz wrote:
Hi!
We have some of these entries in our build.xml files:
<if>
<isset property="Model.DBPassword" />
<then>
<propertyfile file="${dest.dir}/${project.name}.woa/Contents/
Resources/Properties">
<entry key="Model.DBPassword" operation="=" value="$
{Model.DBPassword}"/>
</propertyfile>
</then>
</if>
Just make sure you have the properties you want to set, with the
right values, on a file that is read by the ant script. Also, note
that you need to install ant-contrib for the "if" tag to work.
I see no reason to not do this at build time, but greater minds may
show me wrong.
Yours
Miguel Arroz
On 2008/10/24, at 15:17, William Sandner wrote:
We have 4 different environments that we deploy to, development,
test, staging, and production. We are using ant as our build tool.
For most of our environments we connect to a localhost database
with a common password, but production is on an external server
which has a more secure password. What is the best way to change
the db connection at build time?
Example:
When I build for production, I want to make sure the connection is
pointing to the correct server and the password is correct.
I know I can use ant to search and replace for connection string
tokens in the Properties file, but is this the easiest way?
--
William Sandner
+39 347 4090640 (mobile)
+39 023 6535381 (Milano)
+1 773 828 4363 (Chicago)
+1 773 326 0600 (Fax)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden