Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 51354 invoked from network); 4 Nov 2010 17:35:29 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 4 Nov 2010 17:35:29 -0000 Received: (qmail 77503 invoked by uid 500); 4 Nov 2010 17:35:59 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 77446 invoked by uid 500); 4 Nov 2010 17:35:58 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 77438 invoked by uid 99); 4 Nov 2010 17:35:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Nov 2010 17:35:58 +0000 X-ASF-Spam-Status: No, hits=4.5 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,SPF_HELO_PASS,SPF_SOFTFAIL,T_TO_NO_BRKTS_FREEMAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of apacheant@hotmail.co.uk does not designate 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Nov 2010 17:35:53 +0000 Received: from sam.nabble.com ([192.168.236.26]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1PE3im-0006tk-P3 for user@ant.apache.org; Thu, 04 Nov 2010 10:35:32 -0700 Date: Thu, 4 Nov 2010 10:35:32 -0700 (PDT) From: Java Jboss To: user@ant.apache.org Message-ID: In-Reply-To: <4CD2E331.6010408@gmx.de> References: <1288888082171-3250375.post@n5.nabble.com> <4CD2E331.6010408@gmx.de> Subject: RE: How to script database upgrade using ANT script MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_15364_14689061.1288892132771" ------=_Part_15364_14689061.1288892132771 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Antoine, =20 Thank you for this update. I am using a linux server. I've been asked to = do this in ANT only. Can you possibly provide me an example of how a simil= ar process might be scripted using ANT? =20 As I have never used ANT or any other similar products before I am using Go= ogle for help. =20 Thank you.=20 Date: Thu, 4 Nov 2010 09:46:31 -0700 From: ml-node+3250409-888287632-143298@n5.nabble.com To: apacheant@hotmail.co.uk Subject: Re: How to script database upgrade using ANT script Hi,=20 you will need to use the task for steps like creating the=20 database and importing the dump into the new schema.=20 Once your database is up, you can use the task to run DDL and=20 DML statements.=20 To check whether a script exists, there is a task called =20 which can set a property if a file is available.=20 For error checking, you can run with failonerror=3D"true" to stop= =20 your build if a script fails.=20 You need to test before hand whether the system commands or the scripts=20 that you will run to create the database and import the dump are=20 returning proper exit statuses. (setting ERRORLEVEL on Windows or $? on=20 UNIX).=20 Regards,=20 Antoine=20 On 11/4/10 12:28 PM, Java Jboss wrote:=20 > Hi,=20 >=20 > I=E2=80=99m a complete newbie to ANT and I need to write an ant script wh= ich=20 > upgrades a database version from base level 1.00 to a given version numbe= r=20 > by running a series of mysql (ver 5.1.45) scripts.=20 >=20 > Using ANT script I need to:=20 > 1) create a database=20 > 2) import mysql database(s) dump to a new schema=20 > 3) check current database version=20 > 4) then check if sql script1 exists=20 > 4.1) if "No" then check for next sql script until it has checked for all= =20 > scripts then "end"=20 > 4.2) if "yes" then run first sql script then check if second sql script= =20 > exists - if "yes" then run second sql script and so on until the required= =20 > database version is reached.=20 > 5) check database version is at correct level then =E2=80=9Cend=E2=80=9D = or else start the=20 > loop again=20 > 6) how can I script error checking also=20 >=20 > Thank you all in advance.=20 >=20 ---------------------------------------------------------------------=20 To unsubscribe, e-mail: [hidden email]=20 For additional commands, e-mail: [hidden email]=20 View message @ http://ant.1045680.n5.nabble.com/How-to-script-database-upgr= ade-using-ANT-script-tp3250375p3250409.html=20 To unsubscribe from How to script database upgrade using ANT script, click = here.=20 =09=09 =09 =09=09 =20 --=20 View this message in context: http://ant.1045680.n5.nabble.com/How-to-scrip= t-database-upgrade-using-ANT-script-tp3250375p3250488.html Sent from the Ant - Users mailing list archive at Nabble.com. ------=_Part_15364_14689061.1288892132771--