开发者

How do I use MailLogger in an Ant script?

I am using one Ant and Perl script for开发者_运维知识库 deploying the patches and build in testing machines.

For this I am invoking different targets like Backup, Unzip, Deploy, Log and Mail for performing deployment.

But I want to send mail a to the developer regarding where our script has failed. For example, if it failed at the Deploy target, I want to mail the developer that deployment failed at the Deploy target, even though it's not reaching the mail task target because it has already failed at the Deploy target.

How can use MailLogger to send mail?

My script is:

<?xml version="1.0"?>
<project name"xyz" default="D">
<target name"Backup">
</target>
<target name"Unzip">
</target>
<target name"Deploy">
</target>
<target name"Log">
</target>
<target name"Mail">
</target>
</project>


Using the maillogger won't tell you the name of the target where your build has failed. You may use some try/catch/finally construct available via ant addons like
Flaka
Antcontrib / Antelope
and then use the mailtask in the catch block to send your mails, setting the subject, the mailbody and
attachments (f.e. the logs caught with record task) to your like..

Otherwise if you need more feedback for your clients you should consider using a real continous integration tool like Jenkins/Hudson, Cruisecontrol .. Beside mail notification they provide a dashboard with all the details

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜