ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ankita Kapadia" <ankita_kapa...@persistent.co.in>
Subject RE: sending mails o build failure
Date Fri, 10 Sep 2004 10:57:18 GMT
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.log"
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.log"
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


Mime
View raw message