jenkins Email-ext plugin插件中Pre-send Script设置说明

在使用jenkins Email-ext plugin发送邮件时,项目中使用了SVN去同步,发现每次有同步,都会发送邮件,现只想SVN只更新,不发送邮件通知,这就要在Pre-send中做修改

看看官网说明:

Pre-send Script
The pre-send script is a feature which allows you to write a script that can modify the MimeMessage object prior to sending. This would allow adding custom headers, modifying the body, etc. Predefined variables include:
msg - the MimeMessage object which can be modified
logger - a PrintStream and will write to the job's log. 
build - the build this message belongs to
cancel - a boolean, which when set to true will cancel the sending of the email

  只官网中可以看到cancel可以满足我们的需求,只要设置cancel为true就行,怎么设置呢?

下面这样写吗?

Jenkins > Manage > script 
if (build.changeSet.emptySet) cancel=true;

  好像也不对,在多次尝试后,发出其实只需要这样写就可以

如下图:

转载于:https://www.cnblogs.com/landhu/p/7110152.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值