Java Mailing List Archive

http://www.ant-tasks.com/

Apache Ant Archive

» Ant Users List
» Ant Developers List
Deploying to multiple servers

Deploying to multiple servers

2003-03-07       - By Naresh Bhatia
Reply:     1     2     3     4     5     6     7  

I need to write an ant script to deploy to multiple servers. The number
of servers and their properties should be configurable.

For example, I may want to specify that
1) We need 3 servers: server1, server2 and server 3
2) The servers listen on ports 5000, 6000 and 7000
3) Each server needs a log4j.xml file that should be copied from a
template log4j.xml file, except that the log file name within this
template should be replaced with <server-name>.log. For example,
server1.log.

What is the best way to do this? I started off by using Ant properties
and <foreach> to loop through the servers, but my solution does not look
very elegant:

servers=server1,server2,server3
server1.port=5000
server2.port=6000
server3.port=7000
...

Thanks.
Naresh

©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.