在使用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;

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

如下图:

最新文章

  1. 读IT小小鸟有感
  2. 一个ActionResult中定位到两个视图—<团委项目>
  3. jquery 常用插件
  4. mysql高级排序&高级匹配查询示例
  5. 如何分割一个utf8字符串(保证单个汉字的完整性)
  6. HDU 1546 Idiomatic Phrases Game(最短路,Dijsktra,理解题意很重要)
  7. 在Apache中开启虚拟主机
  8. poptest老李谈数据结构中深度优先和广度优先
  9. linux命令类型及执行顺序
  10. Hive 自定义函数
  11. 泡菜的使用pickle
  12. C语言程序设计第二次作业1
  13. BZOJ bzoj1396 识别子串
  14. Java源码阅读顺序
  15. jQuery使用CDN加速
  16. MPLAB IDE 细节点问题不定期更新ing
  17. 二进制安装MongoDB
  18. maven项目没有src/test/java和src/test/resources目录问题解决
  19. innodb mvcc多版本实现
  20. mysqldump备份成压缩包

热门文章

  1. SCXcodeSwitchExpander自动填充switch语句下枚举类型case
  2. web_submit_data详解
  3. webpack学习简单总结
  4. java图片裁剪和java生成缩略图
  5. VSCode------.net core2.0发布后配置到Window Service 2008R2报500错误
  6. Linux wget 命令下载文件
  7. CM和CDH的安装-准备工作
  8. X-WAF简单测试体验
  9. 重命名和重定向RF执行生成的output文件
  10. FPGA连接