> -----Original Message----- > From: Java Jboss [mailto:apache...@hotmail.co.uk] > Sent: 04 November 2010 22:43 > To: user@ant.apache.org > 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. -- Regards, Darragh Bailey --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@ant.apache.org