ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Java Jboss <>
Subject RE: How to script database upgrade using ANT script
Date Fri, 05 Nov 2010 11:25:03 GMT

Hi Darragh,
can you please provide an example of how I could do this?

Date: Fri, 5 Nov 2010 03:49:57 -0700
Subject: RE: How to script database upgrade using ANT script


> -----Original Message----- 
> From: Java Jboss [mailto:[hidden email]] 
> Sent: 04 November 2010 22:43 
> To: [hidden email] 
> Subject: RE: How to script database upgrade using ANT script 
> Hi Antoine, 
> Thank you very much for providing me this example. 
> unfortunately I've been asked to use ANT only without using 
> unix shell scripts.  I have tried to tackle it as individual 
> modules using ANT script  running the 1st iteration of the 
> mysql scripts against newschema1.  I need to run each 
> iteration against all 4 schemas, then it would do a version 
> check and if version check wasn't met then it would start 2nd 
> iteration and so on. 
> I would appreciate if you could take a look at the script and 
> assist. I need to create a recursive loop which I can't do 
> and also some error checking module as well as some how 
> linking these modules together so that they depend on each 
> other etc... At the moment I have to run each target on its own. 
> Please feel free to change my novice attempt at writing an ANT script. 
> Thank you 
> <!-- *************************************** 
>   Restore MySQL database 
>   **************************************** -->   
> <target name="restore-db" > 
>     <!-- Clean up the database by deleting and then creating it. --> 
>     <antcall target="delete_db"/> 
>     <antcall target="create_db"/> 
> <!-- Import data from the backup file. --> 
>     <exec executable="${my.sql}" input="db_dumps/db1.sql"> 
>       <arg value="--user=root"/> 
>       <arg value="--password=<password>"/> 
>       <arg value="--host=localhost" />   
>       <arg value="--port=3306" />   
>       <arg value="<newschema1>"/> 
Take a look at the apply task to see if you can remove a number of mostly duplicated steps.

Darragh Bailey 

To unsubscribe, e-mail: [hidden email] 
For additional commands, e-mail: [hidden email] 

View message @

To unsubscribe from How to script database upgrade using ANT script, click here. 
View this message in context:
Sent from the Ant - Users mailing list archive at

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message