ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anthony Rodriguez <>
Subject RE: using ant in the deploy process
Date Thu, 20 Sep 2001 22:39:59 GMT
Thank you for your response Diane.  I actually perused thru the mailings and
found a couple of replies you sent about the task.  I don't
know if it can do what I want however.
In a nutshell, I want to ftp, copy, etc a folder full of java and asp files
to several servers.  The servers will change from build to build.  The
number of servers could also vary from one to many.  I was looking into the
script task and I have a rudimentary knowledge of Javascript (I know how to
make pop up windows from a web page :~).  Would you happen to know if I can
accomplish this sort of thing with the script task?  Here's some pseudo code
as to what I would like to do:

<target name="deploy_sites"> 
  <script language="javascript"> 
        New array sites="site1 site2 site3";  #the elements will come from a
properties file
        for(int i=0;i<length.(sites);i++) { 
                <antcall target="deploy"> 
                        <param name="site" value="site[i]"/> 


<target name="deploy"> 
        <exec executable="xcopy.exe">
		<arg line="/S /E ${cabinet} ${site}"/>

<target name="main" depends="deploy_sites"> 

Then from the command line I can call "ant main -buildfile deploy.xml".

Am I even close with the pseudocode?


-----Original Message-----
From: Diane Holt []
Sent: Thursday, September 20, 2001 3:24 PM
Subject: RE: using ant in the deploy process

--- Anthony Rodriguez <> wrote:
> I would like to pass the servers to deploy to at the command line.

In what way do you plan to pass more than one in on the command line? Do
you have a (potential) property for each server?

> I could write a task for each and every server that can get deployed to

Do you mean target?

> I guess what I am really asking for here is a list and a foreach loop. 
> I looked thru earlier listings and saw that there is a foreach task out
> there. Anyone know where I can get it?

I can give it to you -- but since it's not Official Ant, maybe there's a
way to avoid having to use it.

> If there isn't a foreach and array for ant, does anyone know any good
> resources for how to use the script task?  Or more specifically, how to
> use the script task with Perl?

I've only used it with javascript, but I seem to remember there being
something weird about the perl stuff with it (just don't remember now
exactly what the weirdness was).



Terrorist Attacks on U.S. - How can you help?
Donate cash, emergency relief information

View raw message