[英]Jenkins email-ext plugin add a trigger for a specific build failure
I have email-ext plugin configured on Jenkins.我在 Jenkins 上配置了 email-ext 插件。 Currently I'm sending mails using following triggers.
目前我正在使用以下触发器发送邮件。
What I need to know, is there a way to add a custom trigger to send mails on a specific build failure我需要知道的是,有没有办法添加自定义触发器以在特定构建失败时发送邮件
assume that I need to send a mail on build Failure-4th假设我需要在第 4 次构建失败时发送邮件
You can use Trigger Scripts in groovy to define before or after the build if the email must be send or not.您可以在 groovy 中使用 Trigger Scripts 来定义构建之前或之后是否必须发送电子邮件。 There are four objects added to the model for the script to use to interact with the build.
有四个对象添加到模型中,供脚本用于与构建交互。
AbstractBuild
AbstractBuild
的子类AbstractProject
AbstractProject
的子类PrintStream
that can be used to log messages to the build log. PrintStream
。 The last line in the script should resolve to a boolean true
or false
.脚本中的最后一行应该解析为布尔值
true
或false
。
So I guess you can do what you want if you use a Groovy Script.所以我想如果你使用 Groovy 脚本,你可以做你想做的。 For more info check: e-mail ext
欲了解更多信息,请查看:电子邮件分机
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.