我喜歡將我的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。 –