zoukankan      html  css  js  c++  java
  • 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;
    

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

    如下图:

  • 相关阅读:
    2020软件工程作业05
    2020软件工程作业00--问题清单
    2020软件工程作业03
    2020软件工程作业02
    2020软件工程作业01
    软件工程个人作业06
    软件工程作业04
    软件工程作业05
    软件工称作业03
    2020软件工程作业02
  • 原文地址:https://www.cnblogs.com/landhu/p/7110152.html
Copyright © 2011-2022 走看看