简体   繁体   English

如何从Jenkins构建失败电子邮件的收件人中删除用户

[英]How to remove a user from recipients of Jenkins build failure email

I'm receiving daily "Jenkins build is unstable" emails for a project I'm no longer working on. 我每天都收到“Jenkins build is unstable”的电子邮件,这是我不再处理的项目。

I can see from the build result (build.xml) that I'm in the list of "culprits", because of a commit I made some time ago, and since the build has been unstable for weeks, the list of culprits hasn't been cleared. 我可以从构建结果(build.xml)中看到我在“罪魁祸首”列表中,因为我前一段时间提交了一个提交,并且由于构建已经不稳定几周,所以罪魁祸首列表中没有被清除了。

Since I'm no longer working on this project, I want to stop receiving email notifications from this Jenkins job. 由于我不再从事这个项目,我想停止接收这个Jenkins工作的电子邮件通知。 How can I remove myself from the recipients? 如何从收件人中删除自己? Should I edit the build.xml of the last build? 我应该编辑上一次构建的build.xml吗? (EDIT: apparently this approach doesn't work) (编辑:显然这种方法不起作用)

It is possible, but a little complicated. 可能的,但有点复杂。 First, you need to stop Jenkins or send it to quiet mode to avoid further builds. 首先,您需要停止Jenkins或将其发送到安静模式以避免进一步构建。

As the actual list of culprits is calculated at runtime from all recently failed builds, you need to remove your ID from the culprits list in the build.xml of all failed builds (since the last successful one) where it is listed. 由于实际的罪魁祸首列表是在运行时从所有最近失败的构建中计算出来的,因此您需要从列出它的所有失败构建(自上次成功构建的构建版本)的build.xml中的罪犯列表中删除您的ID。

Finally restart Jenkins so the internal data structure is updated from the modified build.xmls. 最后重启Jenkins,以便从修改后的build.xmls更新内部数据结构。

So, if build 10 was the last successful one, you need to remove the ID from builds/11/build.xml, builds/12/build.xml, etc. 因此,如果构建10是最后一个成功的构建,则需要从builds / 11 / build.xml,builds / 12 / build.xml等中删除ID。

Could you just spam filter/block the email by title in your email client? 您可以在电子邮件客户端中通过标题垃圾邮件过滤/阻止电子邮件吗? Most Jenkins build emails will have a common title (with different only in status, build number). 大多数Jenkins构建的电子邮件都有一个共同的标题(仅在状态,内部版本号上有所不同)。 Builds from different jobs will have different common titles. 来自不同工作的构建将具有不同的共同标题。 So block the "offending" email by title. 因此,按标题阻止“违规”电子邮件。

To get Jenkins to 'release' you from the culprits, the build has to succeed. 为了让詹金斯从罪犯中“释放”你,构建必须成功。 If you have access to the job configuration, you can make a fake success build (a simple "exit 0" in the command line will suffice), but this will clear all other culprits too. 如果您有权访问作业配置,则可以进行虚假的成功构建(命令行中的简单“退出0”就足够了),但这也将清除所有其他罪魁祸首。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Jenkins中向开发人员发送电子邮件通知以进行构建失败 - how to send email notification to developer for build failure in Jenkins Jenkins - 在构建失败后发送 email - Jenkins - sending email after build fails with multiple recipients Jenkins管道电子邮件未在构建失败时发送 - Jenkins pipeline email not sent on build failure 如何以编程方式设置 Jenkins Email-ext 插件的收件人? - How to set programmatically recipients of Jenkins Email-ext plugin? 如何以编程方式设置詹金斯工作的电子邮件收件人 - How do i programatically set the email recipients for a jenkins job 如果激活了自动回复,则从Outlook电子邮件中删除收件人 - Remove recipients from Outlook email if automatic reply is activated Jenkins电子邮件通知因编译错误而导致构建失败 - Jenkins email notification for build failure due to compile error 在用户使用 ZC31B323641CE19CA8FCD150CE 发送邮件后,如何从 android 中的 email 意图中提取收件人 email id? - How to extract recipients email id from email intent in android after user has sent mail using android app? 阻止收件人收到电子邮件。 - 电子邮件处理的工作原理 - Preventing Recipients from getting an email. - How Email Processing Works? 在Jenkins Groovy电子邮件中包括构建请求用户 - Include Build request user in jenkins groovy email
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM