Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我们Jenkins用作我们的 ci 服务器,并在 firefox 上运行集成测试xvfb。有时,我们会收到关于测试失败的电子邮件,原因是xvfb启动失败。
Jenkins
xvfb
所以我们想忽略这种情况下发送电子邮件。众所周知,该email-ext插件可以帮助我们。我们应该写pre-send scripts,但我们不知道如何写。
email-ext
pre-send scripts
当失败输出消息包含指定的错误消息时,如何编写脚本来取消发送电子邮件?
我groovy script的电子邮件分机插件预发送脚本是:
groovy script
try { def logFilePath = build.getLogFile().getPath(); String logContent = new File(logFilePath).text; if (logContent.find(/Xvfb failed to start/)) cancel=true; } catch (all) { }
这解决了我的问题。