jenkins Email-ext plugin插件中Pre-send Script设置说明
2024-08-23 00:23:09
在使用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;
好像也不对,在多次尝试后,发出其实只需要这样写就可以
如下图:
最新文章
- 读IT小小鸟有感
- 一个ActionResult中定位到两个视图&mdash;<;团委项目>;
- jquery 常用插件
- mysql高级排序&;高级匹配查询示例
- 如何分割一个utf8字符串(保证单个汉字的完整性)
- HDU 1546 Idiomatic Phrases Game(最短路,Dijsktra,理解题意很重要)
- 在Apache中开启虚拟主机
- poptest老李谈数据结构中深度优先和广度优先
- linux命令类型及执行顺序
- Hive 自定义函数
- 泡菜的使用pickle
- C语言程序设计第二次作业1
- BZOJ bzoj1396 识别子串
- Java源码阅读顺序
- jQuery使用CDN加速
- MPLAB IDE 细节点问题不定期更新ing
- 二进制安装MongoDB
- maven项目没有src/test/java和src/test/resources目录问题解决
- innodb mvcc多版本实现
- mysqldump备份成压缩包