File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Continuous Integration: builds for different environments

 
Gian Franco
blacksmith
Ranch Hand
Posts: 979
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Andrew Glover
author
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)?
 
Gian Franco
blacksmith
Ranch Hand
Posts: 979
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Gian Franco
blacksmith
Ranch Hand
Posts: 979
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 29
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic