简体   繁体   English

Jenkins-电子邮件扩展插件-模板

[英]Jenkins - Email-ext plugin - Templates

I am using the Jenkins plugin called email-ext and I want to get Jenkins to send an email generated from the html.jelly template which is located in $JENKINS_HOME/email-templates. 我正在使用名为电子邮件扩展的Jenkins插件,我想让Jenkins发送从html.jelly模板生成的电子邮件,该模板位于$ JENKINS_HOME / email-templates中。 The email should be always send when the code of a specific repo is built. 构建特定回购代码后,应始终发送电子邮件。

I have configured the email-ext plugin to always send the email when that specific repo is built and in the field 'Default Pre-send Script' I have referenced the template: ${JELLY_SCRIPT,template="html"} 我已将email-ext插件配置为始终在构建该特定存储库时发送电子邮件,并且在“默认预发送脚本”字段中,我引用了模板:$ {JELLY_SCRIPT,template =“ html”}

However, when Jenkins builds the code the jelly script fails with the following error: 但是,当Jenkins构建代码时,果冻脚本失败,并出现以下错误:

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script1.groovy: 1: unexpected token: < @ line 1, column 1.

   <STYLE>
   ^

1 error
at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:302)
at org.codehaus.groovy.control.ErrorCollector.addFatalError(ErrorCollector.java:149)
at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:119)
at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:131)
at org.codehaus.groovy.control.SourceUnit.addError(SourceUnit.java:359)
at org.codehaus.groovy.antlr.AntlrParserPlugin.transformCSTIntoAST(AntlrParserPlugin.java:142)
at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:108)
at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:236)
at org.codehaus.groovy.control.CompilationUnit$1.call(CompilationUnit.java:161)
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:846)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:550)
at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:526)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:503)
at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:302)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:281)
at groovy.lang.GroovyShell.parseClass(GroovyShell.java:731)
at groovy.lang.GroovyShell.parse(GroovyShell.java:743)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:578)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:618)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:589)
at hudson.plugins.emailext.ExtendedEmailPublisher.executePresendScript(ExtendedEmailPublisher.java:450)
at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:311)
at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:297)
at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:244)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:721)
at hudson.model.Build$BuildExecution.cleanUp(Build.java:192)
at hudson.model.Run.execute(Run.java:1764)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)

Do you have any solutions to solve this problem? 您有解决此问题的解决方案吗? I appreciate any help, Thank you! 感谢您的帮助,谢谢!

Please provide Jenkins and Email-ext version numbers. 请提供Jenkins和Email-ext版本号。

Try to put ${JELLY_SCRIPT,template="html"} in the email "Default Content" That should work. 尝试将$ {JELLY_SCRIPT,template =“ html”}放入应该有效的电子邮件“默认内容”中。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM