ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ashutosh Kumar" <ashutosh.ku...@ionidea.com>
Subject RE: sending mails o build failure
Date Sat, 11 Sep 2004 12:56:00 GMT
Ankita
I could not understand 1st two lines of code. Why grep is used? And how
I am linking my build process to this snippet of code? Can u pls
explain?
Regds
Ashutosh

-----Original Message-----
From: Ankita Kapadia [mailto:ankita_kapadia@persistent.co.in] 
Sent: Friday, September 10, 2004 4:27 PM
To: Ant Users List
Subject: RE: sending mails o build failure

Here is a snippet of code I used :-

*************Grep for SUCCESS/FAILURE *******************
<exec dir="${prop.buildlocation}" executable="grep" os="Windows 2000"
resultproperty="status" failonerror="false" >
<arg value= "error"/>
<arg value= "${prop.buildlocation}\build.log"/>
</exec>

<condition property="status.failed">
<equals arg1="0" arg2="${status}" />
</condition>
<antcall target="buildsuccess" />
<antcall target="buildfail" />
</target>

<target name="buildsuccess" unless="status.failed">
  <tstamp>
     <format property="NOW" pattern="yyyy MMMM dd HH:mm:ss"
locale="en"/>
   </tstamp>
    <!-- UnWwar the war file into webapps\xyz folder -->
    <unwar src="${WarFileName}" dest="${UnWarLocation}" />
    <echo level="info">
    *************UNWAR done...*******************
    </echo>

<mail failonerror="false" mailhost="smtp.persistent.co.in"
subject="BUILD
SUCCESSFUL :-) ${TODAY}" user="xyz" password="whyshuditellu"
files="${prop.buildlocation}\clearcase.log,${prop.buildlocation}\build.l
og"
tolist="${prop.mailtolist}" >
    <from name="xyz@persistent.co.in" address="xyz@persistent.co.in"/>
    <message>
         **************************************************
         Completed Pines Build
            Build Status		: BUILD SUCCESSFUL
         **************************************************
     </message>
 </mail>
</target>

<target name="buildfail" if="status.failed">
 <tstamp>
 <format property="NOW" pattern="yyyy MMMM dd HH:mm:ss" locale="en"/>
 </tstamp>

<mail failonerror="false" mailhost="smtp.persistent.co.in"
subject="BUILD
FAILED :-( ${TODAY}" user="xyz" password="whyshuditellu"
files="${prop.buildlocation}\clearcase.log,${prop.buildlocation}\build.l
og"
tolist="${prop.mailtolist}" >
    <from name="xyz@persistent.co.in" address="xyz@persistent.co.in"/>
 <message>
  *************************************************
   Completed Pines Build
  Build Status		: BUILD FAILED
 **************************************************
   </message>
 </mail>
</target>




-----Original Message-----
From: Ashutosh Kumar [mailto:ashutosh.kumar@ionidea.com]
Sent: Saturday, September 11, 2004 4:07 PM
To: user@ant.apache.org
Subject: sending mails o build failure


How can I send emails automatically when build fails?through ant/maven?
Regds
Ashutosh


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



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


Mime
View raw message