我正在尝试找到一种方法来使用常规变量而不是使用硬编码的模板名称
当前代码如下所示:'${SCRIPT, template="groovy-html.template"}'
我尝试使用嵌套变量扩展,但仍然出现错误。
Example:
def body = '''${SCRIPT, template="${template}"}'''
找不到 Groovy 模板文件 [${template}]
$JENKINS_HOME/电子邮件模板。使用 text.jelly 模板生成。
我的电话可以在以下位置看到https://github.com/pycontribs/powertape/blob/master/vars/notifyBuild.groovy#L47 https://github.com/pycontribs/powertape/blob/master/vars/notifyBuild.groovy#L47
def sendEmail(String subject, String template)
{
def bodyContent = "\${SCRIPT, template=\"${template}\"}"
emailext subject: "${subject}",
body: bodyContent,
recipientProviders: [[$class: 'RequesterRecipientProvider']]
}
以上对我有用。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)