Jenkins Email-ext plugin build log all on one line -
ive seen sort of asked in various places haven't found true answer.
does know how make build log thats displayed in body using html.jelly template not run , separate each line line break?
im pretty sure answer lies sort of change needs happen template have no idea begin.
right in email:
[copy] copying 1 file /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 /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 @ /opt/hybris/hybris/bin/platform/tomcat-6 [echo] using config set @ /opt/hybris/hybris/config/tomcat [echo] [copy] copying 8 files /opt/hybris/hybris/bin/platform/tomcat-6 [copy] copying 6 files /opt/hybris/hybris/bin/platform/tomcat-6 [copy] copying 1 file /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 triggered for: success sending email trigger: success
but want this...
[copy] copying 1 file /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 /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 @ /opt/hybris/hybris/bin/platform/tomcat-6 [echo] using config set @ /opt/hybris/hybris/config/tomcat [echo] [copy] copying 8 files /opt/hybris/hybris/bin/platform/tomcat-6 [copy] copying 6 files /opt/hybris/hybris/bin/platform/tomcat-6 [copy] copying 1 file /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 triggered for: success sending email trigger: success
sorry keep waiting long. today can access jenkins server , tried jelly template , works fine.
first of all, wiki of ext-mail plug-in useful, here link:ext-mail wiki
my jenkins' install path same yours: /var/lib/jenkins/, have not find jelly template file html.jelly, use file wiki, , here link: html.jelly
now show have done , result got:
actually put template file html.jelly in /var/lib/jenkins/email-templates, note according wiki, need create folder email-templates under jenkins installed folder ext-mail plug-in can access template file. have no tried path specified, don't know if still work if put html.jelly under directory: /var/lib/jenkins/plugins/email-ext/web-inf/lib/hudson/plugins/emailext/templates.
rename html.jelly html_my.jelly.
- modify html_my.jelly, comment below 3 lines console log show up.
<!-- <j:getstatic var="resultfailure" field="failure" classname="hudson.model.result"/> <j:if test="${build.result==resultfailure}"> --> <table width="100%" cellpadding="0" cellspacing="0"> <tr><td class="bg1"><b>console output</b></td></tr> <j:foreach var="line" items="${build.getlog(100)}"><tr><td class="console">${line}</td></tr></j:foreach> </table> <br/> <!-- </j:if> -->
jenkins -- manage jenkins -- configure system -- extended e-mail notification. set "default content type" "html (text/html)", , set default content here
${jelly_script, template="html_my"}
, , think can set default content in job's configuration work. refer image here:in job's configuration, need modify content type "html (text/html)", , need specify trigger type. refer image of configure job:
as can see, below image email content of temp job, hope , if have more question, please let me know.
by way, it's wonderful use groovy template, can try!
Comments
Post a Comment