ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erskine, Chris" <chris.ersk...@eds.com>
Subject RE: sending mails o build failure
Date Fri, 10 Sep 2004 11:13:03 GMT
This sounds like you are trying to automate your build.  I would try looking
at one of the automated build systems like CruiseControl.  It will rebuild
the system after changes have been checked in and then send email on
failures.

Chris Erskine
 
EDS Consulting Services
F5-EDS-001
2424 Garden of the Gods Rd
Colorado Springs, CO  80919
 
Phone: 719-535-6064
 
Phone:
mailto:chris.erskine@eds.com
-----Original Message-----
From: Ankita Kapadia [mailto:ankita_kapadia@persistent.co.in] 
Sent: Friday, September 10, 2004 4:57 AM
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.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

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


Mime
View raw message