【问题标题】:Email-Ext objects in groovy script as filegroovy 脚本中的电子邮件分机对象作为文件
【发布时间】:2016-04-12 11:40:23
【问题描述】:

我的问题是对此的跟进: How to place Email-Ext groovy script on the jenkins file system

这是我的情况: 我有一个 groovy 脚本,用于构建将要发送的电子邮件。 只要我将脚本(代码)直接写在:

预发送脚本


如果我使用此脚本,请将其放在 Jenkins 文件系统(...jenkins\email-templates) 中:email-presend.groovy,然后我尝试使用以下命令调用它:

  <presendScript>${SCRIPT, script="email-presend"}</presendScript>

我收到错误消息,我无法访问消息对象:

Script1.groovy:1:期待 EOF,在第 1 行第 17 列找到“或”。 脚本或模板中的错误:groovy.lang.MissingPropertyException:没有这样的属性:类的 msg:Script1

代码就行了:

  msg.addHeader("X-Priority", "1 (Highest)"); 
  msg.addHeader("Importance", "High"); 

我是否遗漏了一些明显的东西,因为我找不到任何代码 sn-p 做到这一点? 如果代码直接在 jenkins 中,我想使用 javax.mail.Message 消息。

【问题讨论】:

  • 没人遇到这个问题吗?其余部分是如何通过 groovy 写入电子邮件的?
  • 尝试改用 SCRIPT(script: "email-presend")。

标签: jenkins groovy email-ext


【解决方案1】:

不幸的是,根据这篇文章,这似乎是不可能的: Email-ext comment

太糟糕了:(

【讨论】:

    猜你喜欢
    • 2016-12-03
    • 2013-09-17
    • 2017-11-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多