我喜欢将我的Jenkins电子邮件脚本提交给我的工作副本,并将其用于Email-ext。如何更改Email-ext插件以从自定义位置加载脚本
所以我写了类似:
pipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Building...'
}
}
}
post {
always {
echo 'Sending email...'
emailext body: '''${SCRIPT, template="${WORKSPACE}\\Src\\Scripts\\Jenkins\\groovy-html2.template"}''',
mimeType: 'text/html',
subject: "[Leeroy Jenkins] ${currentBuild.fullDisplayName}",
to: "[email protected]",
replyTo: "[email protected]",
recipientProviders: [[$class: 'CulpritsRecipientProvider']]
}
}
}
但我得到以下邮箱: Groovy的模板文件[$ {WORKSPACE} SrcScriptsJenkinsgroovy-html2.template在$ JENKINS_HOME /电子邮件模板没有被发现。
确定它是出于安全原因?有一个公开的问题:[JENKINS-43903](https://issues.jenkins-ci.org/browse/JENKINS-43903) – user3360767
是的,我是插件的维护者。 –
我已关闭该票作为wontfix。 –