【发布时间】:2017-04-21 23:56:54
【问题描述】:
在我的管道脚本中,我添加了一些环境变量,但无法在 email-ext 插件中访问它
env.MYVAR = 'HELLO'
emailext body: '${ENV,var="MYVAR"}', subject: 'subject', to: 'hello@world.com'
由于我正在从文件中读取电子邮件正文,我也尝试替换字符串,但在 org.codehaus.groovy.runtime.StringGroovyMethods.replaceAll 出现 java.lang.NullPointerException
def myvariable = 'HELLO WORLD'
def content = readFile 'template.html'
content = content.replaceAll('MYVAR',myvariable)
...
有什么想法吗?谢谢!
【问题讨论】:
标签: jenkins jenkins-pipeline jenkins-email-ext