wood burning stoves 2.0*
The moose likes Agile and Other Processes and the fly likes Continuous Integration: builds for different environments Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » Agile and Other Processes
Bookmark "Continuous Integration: builds for different environments" Watch "Continuous Integration: builds for different environments" New topic
Author

Continuous Integration: builds for different environments

Gian Franco
blacksmith
Ranch Hand

Joined: Dec 16, 2003
Posts: 975
Dear authors,

I mentioned in a previous post that I have this one script
that takes care of the CI builds.

Right now there is still an ugly manual step that needs to
be performed: a property file needs to be updated with
entries that depend on the deployment environment.

This means the war's cannot be just sent to, for example, the
webapp folder of Tomcat-Apache...it needs to be expanded
just to replace/change the property file

I know JNDI offers solutions, alternatively maybe I could solve
it like we've done for a Ruby on Rails project: with environment
variables.

Do you have any suggestions on this point?

Gian
[ August 28, 2007: Message edited by: Gian Franco ]

"Eppur si muove!"
Andrew Glover
author
Greenhorn

Joined: Dec 19, 2002
Posts: 16
Does the property file's data change from deployment to deployment (i.e. if you deploy to environment A today with property file X does a deployment to A tomorrow mean X changes again)?


Certified City Slicker
Gian Franco
blacksmith
Ranch Hand

Joined: Dec 16, 2003
Posts: 975
The property file only sporadically changes in each environment.

But I do a unique build that generates a war, that I would like to use for more deployment environments (i.e. local, acceptation, and production)

Since acceptation and production use different resources I have to manually change properties everytime the war goes from one environment to the other.

I wouldn't like to do different builds for each environment.

Gian
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Well, it certainly sounds like those configurable values should be configured somewhere outside the war file.

System properties would be one way to do it, if you only have few of them.

Another would be a properties or other configuration file outside the war.

Can you tell us more about what you need to configure?


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Gian Franco
blacksmith
Ranch Hand

Joined: Dec 16, 2003
Posts: 975
Hi Ilja,

The property file contains things like the database url, the
mail server details...

These things vary in each environment.

Gian
Paul Duvall
author
Greenhorn

Joined: Jul 17, 2007
Posts: 29
The property file contains things like the database url, the
mail server details...

These things vary in each environment.


What I've done is to use a .properties file for each environment: dev.properties, qa.properties, staging.properties and so on. If I want to override anything locally, such as from my developer workstation, I'll read a local.properties first (the values of this file are not checked into the version control system). Because of the immutability of properties in Ant, this works well.


Co-author of <a href="http://www.amazon.com/gp/product/0321336380/" target="_blank" rel="nofollow">Continuous Integration: Improving Software Quality and Reducing Risk </a> <br />(Addison-Wesley Martin Fowler Signature Series, 2007). Companion website for the book is <a href="http://www.integratebutton.com/" target="_blank" rel="nofollow">IntegrateButton.com</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Continuous Integration: builds for different environments
 
Similar Threads
Using ANT to deploy
Properties File Versus JDBC Lookup
JNDI in Enterprise application in Eclipse
[SPRING] Using .properties File
Best Practices - Properties files