ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shailesh Sharma <shailesh_s...@yahoo.com>
Subject Re: pass parameters from build.xml to my shell script ??
Date Tue, 30 Sep 2003 14:41:00 GMT
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
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message