forrest-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles VANDAELE <gilles.vanda...@advalvas.be>
Subject Re: deploying forrest with environment variables
Date Fri, 24 Feb 2006 08:25:03 GMT
Ross Gardler <rgardler <at> apache.org> writes:

> 
> Gilles VANDAELE wrote:
> > Hi,
> > I'd like to deploy forrest as a webapp, and include the environment as a
> > parameter in the command line. This parameter should be used to set some
> > variable in the site.xml, depending on the environment targeted.
> > Any way to pass variable from Ant to site.xml?
> 
> I'm not aware of any easy way to do this in 0.7, it can be done in 
> 0.8-dev very easily.
> 
> Do you want the hard way (0.7) or the easy way (0.8-dev)?
> 
> Either way, please provide a speicifc example of what you want to do, 
> i.e. what property, how will it be used. Please provide code where 
> possible, it prevents confusion in the explanation.
> 
> Ross
> 
> 

I prefer the hard way ;.)

I cant use a dev version for production but let me know also the easy way (if
the hard one is too hard)

In my site.xml, some part of href attributes needs to be set to the right server
adress.
In the xml:
<site ...>
	<external-refs>
		<mySite href="http://localhost:8080/"/>
	</external-refs>
</site>
I would like to replace the 'localhost' and the '8080' by some environment
parameters comming from the command line used to build the war, or coming from
properties choosen with this parameter.
If I build a war for the production environment, I would like to enter 'forrest
war -Denv=production' and the host name and the port should be replaced by the
production one's.

Thanks,
Gilles



Mime
View raw message