• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Continuous Integration: builds for different environments

 
blacksmith
Posts: 979
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
author
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 979
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 979
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic