我正在使用Build Failure Analyzer Jenkins插件,我定义了构建失败的失败原因。
现在,我想存储失败原因输出并通过电子邮件发送。因此,我在使用电子邮件扩展插件的管道中进行了跟踪-
post {
failure {
script {
def subject = "${env.JOB_NAME} - Build # ${env.BUILD_NUMBER}"
def buildFailure = tm('${BUILD_FAILURE_ANALYZER}')
emailext attachLog: false,
body: buildFailure,
subject: subject,
to: "[email protected]"
}
}
在詹金斯(Jenkins)的电子邮件扩展程序配置中,如果Default Content Type
有价值Plain text (text\html)
,我会在电子邮件中获得如下内容-
Identified problems:
* Code compilation failed Actions:
1. Please click on below indication link to know the compilation failure
2. Please resolve compilation errors
* Indication 1:
<http://localhost:9090//job/EmailPipelineCopy/15/consoleFull#1856183693ffa56480-b39d-4982-9c6e-524135dff05e>
这是我期望的,但是如果我设置Default Content Type
为HTML (text\html)
,则在电子邮件中,我会收到类似-
Identified problems: * Code compilation failed Actions: 1. Please click on below indication link to know the compilation failure
2.请解决编译错误*指示1:
显示效果不佳,链接也不可用。我需要设置Default Content Type
为HTML (text\html)
HTML中的电子邮件中的其他内容。
有什么方法可以将HTML内容更改为文本,以便它显示在带有链接的电子邮件中,并与Default Content Type
=保持正确对齐HTML (text\html)
?
我删除<
,并>
从文本字符,并包围它<pre>
的标签,然后HTML处理该文本,因为它是。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句