jenkins - How to change Email-ext plugin to load script from custom location -


i commit jenkins email script working copy , use email-ext.

so wrote :

pipeline {     agent     stages {         stage('build') {             steps {                 echo 'building...'             }         }     }     post {         {             echo 'sending email...'             emailext body: '''${script, template="${workspace}\\src\\scripts\\jenkins\\groovy-html2.template"}''',             mimetype: 'text/html',             subject: "[leeroy jenkins] ${currentbuild.fulldisplayname}",             to: "user@company.com",             replyto: "user@company.com",             recipientproviders: [[$class: 'culpritsrecipientprovider']]         }     } } 

but following mail: groovy template file [${workspace}srcscriptsjenkinsgroovy-html2.template] not found in $jenkins_home/email-templates.

templates must live in correct directory security reasons. if want keep them in scm suggest create jenkins job checks out scm correct directory. technically though directory shouldn't writable is. alternatively can use groovy code in pipeline itself


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -