ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Lybarger <Mark.Lybar...@CBC-Companies.com>
Subject RE: pass parameters from build.xml to my shell script ??
Date Tue, 30 Sep 2003 14:55:18 GMT
I'm not familiar with executing shell scripts like that. i'm familiar with
using $1 $2, etc for parameters passed to unix shell scripts.  then setting
local variables inside the script such as:

export ANT-PATCH=$1
export WEBLOGIC-JAR=$2

etc, etc.

you'll want to use ant -debug or some such (see ant -help

> -----Original Message-----
> From: Shailesh Sharma [mailto:shailesh_scea@yahoo.com]
> Sent: Tuesday, September 30, 2003 10:41 AM
> To: Ant Users List
> Subject: Re: pass parameters from build.xml to my shell script ??
> 
> 
> This is exactly what i wanted to do:
>  
> ------------------------------------------
>  
> i have 3 files in all....
>  
>  
> 1) build.xml looks something like:
>  
>  
> <?xml version="1.0" encoding="iso-8859-1"?>
> <project name="dev" default="all" basedir=".">
>  
>     <property file="./myAnt.properties"/>
>  
>     <target name="xyz">
>         <echo message="***********shailesh sharma deployment"/>
>         <property name="general.deployment.script.name" 
> value="${general.script}" />
>    </target>
>    <target name="shaileshtest">
>         <echo message="This is the TESTNET box"/>
>         <exec dir="${Deploy.scripts.folder}" 
> executable="${Deploy.scripts.folder}/${genera
> l.deployment.script.name}" />
>         <arg line="${ANT-PATCH}"/>
>         <arg line="${WEBLOGIC-JAR}"/>
>         <arg line 
> ADMIN-PORT-NUMBER="${ADMIN-PORT-NUMBER-TEST}"/> // is this 
> correct ????
>         <arg line HOSTNAME="${HOSTNAME-TEST}"/>   // is this 
> correct ???
> --
> --
> --
>  
> // i need to pass the paramter from here that is been defined 
> in myAnt.properties file to the actual shell script called 
> "deployScript.sh"
> // correct me if iam wrong ....i need to specify all the arg 
> names of the shell script OR the arg name of the 
> myAnt.properties file??????
> // iam confused !!!!!!!!!!
>  
>         </exec>
>     </target>
>  
> 
> </project>
> 
> 2) myAnt.properties
>  
> general.script=deployScript.sh
> ANT-PATCH=/user/bea/wlserver6.1/lib/patch.jar
> WEBLOGIC-JAR=/user/bea/wlserver6.1/lib/weblogic.jar
> ADMIN-PORT-NUMBER-TEST=7001
> HOSTNAME-TEST=reliant2
> APP-NAME-TEST=beaMon
> SERVER-NAME-TEST=beamon_biko_s1
> PASSWORD-TEST=weblogic
> APP-PATH-DEPLOYED-FROM-TEST=/export/home/muuserid/applications
> /beamon/beaMon.war
>  
>  
>  
> 3) a shell script called "deployScript.sh" looks something like this:
>  
> java -cp "$ANT-PATCH":"$WEBLOGIC-JAR" weblogic.deploy -port 
> "$ADMIN-PORT-NUMBER" -host "$HOSTNAME" -component 
> "$APP-NAME":"$SERVER-NAME" deploy "$PASSWORD" "$APP-NAME" 
> "$APP-PATH-DEPLOYED-FROM"
>  
> -------------------------------------------
>  
>  
>  
>  
> 
> Shawn <kcat@koyuru.com> wrote:
> Sorry I was going out the door and just didn't have the time.
> 
> I do things like:
> 
> 
> 
> 
> 
> 
> 
> 
> or
> 
> outputproperty="the_value">
> 
> 
> 
> 
> 
> 
> or
> 
> 
> 
> output="${log.dir}/mysql_backup_b.txt">
> ${home.dir}/ant_backup/mysql/hotcopy" />
> 
> 
> done
> 
> 
> 
> Anyway what would your command line look like if you launched 
> your script 
> from the shell.
> 
> You can just break that up using or using 
> (see the docs for the diff and more details).
> 
> (all the above are actually executables but I believe passing 
> parameters to 
> a script would be the same.)
> 
> 
> >> iam checking the docs right now....and could find something like:
> >>
> >> 
> >>
> >> but how could i make this to match with the shell script 
> >> variables.....iam
> > new to ANT/shell script.
> >>
> >> if you can let me know some examples, that would be great !!!!
> >>
> >> -shailesh
> >>
> >>
> >> Shawn wrote:
> >>
> >> easy enough, just check the docs under exec.
> >>
> >> There are several ways to do and it's probably better for 
> you to see it
> >> there than me try to explain it here.
> >>
> >>
> >> >
> >> > Hi,
> >> >
> >> > I want to pass some parameters from my build.xml file to 
> the shell
> >> > script. Iam envoking my shell scripts from the build.xml 
> file(using
> > exec)
> >> > but i need some paramters to be passed to these shell scripts.
> >> >
> >> >
> >> >
> >> > Please advise.
> >> >
> >> >
> >> >
> >> > shailesh
> >> >
> >> >
> >> >
> >> > ---------------------------------
> >> > Do you Yahoo!?
> >> > The New Yahoo! Shopping - with improved product search
> >>
> >>
> >>
> >> -- Shawn
> >>
> >> Happily using M2, Opera's revolutionary e-mail client:
> >> http://www.opera.com/m2/
> >>
> >> 
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> >> For additional commands, e-mail: user-help@ant.apache.org
> >>
> >>
> >> ---------------------------------
> >> Do you Yahoo!?
> >> The New Yahoo! Shopping - with improved product search
> >
> 
> 
> 
> -- 
> Shawn
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> ---------------------------------
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
> 
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.518 / Virus Database: 316 - Release Date: 9/11/2003
>  
> 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.518 / Virus Database: 316 - Release Date: 9/11/2003
 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message