我正在尝试在我们的buildbot系统上发送自定义电子邮件状态通知。在使用MailNotifier时,我找不到在电子邮件主题中获取构建属性的方法。
我在messageFormatter回调函数参数中找到了build对象。但它只能在主体中使用,而不能在主体中使用。
我还尝试通过从我的master.cfg本身调用Json API来使用它,但它不起作用,buildbot服务器进入了某种无限循环。如果单独调用Json api,则可以很好地查询特定于构建的数据。
我使用的是buildbot 0.8.12,并且我是这个框架的新手。谢谢你的帮助。
发布于 2016-06-29 11:30:11
根据MailNotifier的文档字符串:
@param messageFormatter: function taking (mode, name, build, result,
master_status) and returning a dictionary
containing two required keys "body" and "type",
with a third optional key, "subject". The
"body" key gives a string that contains the
complete text of the message. The "type" key
is the message type ('plain' or 'html'). The
'html' type should be used when generating an
HTML message. The optional "subject" key
gives the subject for the email.因此,您只需在结果字典中再添加一个条目,就可以得到您想要的结果。例如。
...
return {..., 'subject': 'Abracadabra %s' % build.getProperty('my-favourite-build-property')}https://stackoverflow.com/questions/37801842
复制相似问题