【发布时间】:2014-03-24 14:36:52
【问题描述】:
我在很多地方都看到过这样的问题,但没有找到真正的答案。
有谁知道如何使用 html.jelly 模板使构建日志显示在正文中,而不是全部一起运行,并且实际上用换行符分隔每一行?
我很确定答案在于模板需要进行某种更改,但我不知道从哪里开始。
现在我在我的电子邮件中收到了这个:
[copy] Copying 1 file to /opt/hybris/hybris/bin/ext-channel/cscockpit/resources/localization [mkdir] Created dir: /opt/hybris/hybris/bin/platform/tomcat-6/work/Catalina/localhost/hmc [echo] [jspcompile] generating.. [echo] [jspcompile] touching jsp files [echo] [jspcompile] compiling.. /opt/hybris/hybris/bin/platform/tomcat-6/work/Catalina/localhost/hmc [yjavac] Compiling 209 source files to /opt/hybris/hybris/bin/platform/tomcat-6/work/Catalina/localhost/hmc [touch] Creating /opt/hybris/hybris/bin/platform/tomcat-6/work/Catalina/localhost/hmc/jspcompile_touch [stopwatch] [build: 36.436 sec] server: [echo] [echo] Configuring server at /opt/hybris/hybris/bin/platform/tomcat-6 [echo] Using config set at /opt/hybris/hybris/config/tomcat [echo] [copy] Copying 8 files to /opt/hybris/hybris/bin/platform/tomcat-6 [copy] Copying 6 files to /opt/hybris/hybris/bin/platform/tomcat-6 [copy] Copying 1 file to /opt/hybris/hybris/bin/platform/tomcat-6/lib [java] Process not found [java] shutting down hybris registry.. all: [echo] Build finished on 24-March-2014 07:09:01. [echo] BUILD SUCCESSFUL Total time: 42 seconds SSH: EXEC: completed after 59,838 ms SSH: Disconnecting configuration [Dev-trunk] ... SSH: Transferred 3 file(s) Email was triggered for: Success Sending email for trigger: Success
但我希望它看起来像这样......
[copy] Copying 1 file to /opt/hybris/hybris/bin/ext-channel/cscockpit/resources/localization
[mkdir] Created dir: /opt/hybris/hybris/bin/platform/tomcat-6/work/Catalina/localhost/hmc
echo]
jspcompile] generating..
[echo]
[jspcompile] touching jsp files
[echo]
[jspcompile] compiling.. /opt/hybris/hybris/bin/platform/tomcat-6/work/Catalina/localhost/hmc [yjavac] Compiling 209 source files to /opt/hybris/hybris/bin/platform/tomcat-6/work/Catalina/localhost/hmc [touch] Creating /opt/hybris/hybris/bin/platform/tomcat-6/work/Catalina/localhost/hmc/jspcompile_touch
[stopwatch]
[build: 36.436 sec] server:
[echo]
[echo] Configuring server at /opt/hybris/hybris/bin/platform/tomcat-6
[echo] Using config set at /opt/hybris/hybris/config/tomcat
[echo]
[copy] Copying 8 files to /opt/hybris/hybris/bin/platform/tomcat-6
[copy] Copying 6 files to /opt/hybris/hybris/bin/platform/tomcat-6
[copy] Copying 1 file to /opt/hybris/hybris/bin/platform/tomcat-6/lib
[java] Process not found
[java] shutting down hybris registry.. all:
[echo] Build finished on 24-March-2014 07:09:01.
[echo] BUILD SUCCESSFUL Total time: 42 seconds SSH: EXEC: completed after 59,838 ms SSH: Disconnecting configuration
[Dev-trunk] ... SSH: Transferred 3 file(s) Email was triggered for: Success Sending email for trigger: Success
【问题讨论】:
-
有一种可能是您没有将邮件内容设置为“HTML”,比如在job的配置部分或系统Email-ext配置部分,请您检查一下吗?抱歉,我无法在家中访问我的 Jenkins 服务器,否则我可以为您提供更详细的信息。
-
是的,它是为 HTML 设置的...这是我在我的默认内容中使用的代码... ${JELLY_SCRIPT,template="html_gmail"} $BUILD_LOG
-
有一个插件的选择列表,它有三个选项:dufault、text、html,请检查
-
是的...它设置为 HTML....默认内容类型 -> HTML
-
哦,对了,如果你指定的jelly脚本有格式错误,哪怕是一个小错误都会导致html模板输出为文本,请问你修改了标准模板吗?如何修改?
标签: email plugins jenkins format jelly