档案:Hermes OBS

(重定向自
跳转到:导航搜索
Icon-trash.png 本文正在考虑删除!
理由

openSUSE 已经不再使用 Hermes,开发已于 2013 年停止。

请勿清空、合并或移动此文章,或删除此通知。请参阅此文章的页面和我们的删除策略以获取更多信息。


此页面解释了Hermes与Open Build Server协同工作的自定义设置


如果您需要进一步的帮助(您很可能需要 ;-),请随时在freenode上的#opensuse-boosters boosters频道IRC中提问。

自定义

Hermes是一个通用工具,它不绑定也不专门针对Open Build Service。它可以很容易地在其他环境中使用。由于它通过herminator通过HTTP接口获取通知,因此连接起来很简单。

为了对Hermes发送的消息进行特定领域的调整,Hermes中有一个自定义模块。默认的Hermes带有一个用于OBS的自定义模块(此处描述),但为其他系统创建特定的自定义模块应该很简单。

Hermes代码中有一些调用自定义的钩子。为了使其工作,请从Hermes复制CustomizeStub.pm模块并实现存根方法。

以下是CustomizeStub文档中关于此的说明

This package can be changed to customize the behaviour of Hermes and 
influence its decisions on who will get a message based on the parameters. 
Currently Hermes calls two interface functions in the Customize.pm module.
These need to be reimplemented!

1. generateSubscriberListRef( $msgType, $params );
   This sub generates a list of users of the system who are subscribed to
   the given MsgType with the also given set of parameters. This is the 
   place where Filters need to be implemented on base of MsgType and 
   the parameters. 

   For example, the Message Type is PRODUCT_CHANGE, but your Hermes has
   a subscription filter filtering on product = name all subscriptions
   that do not pass this filter should be dropped out. Check the 
   example implementation in Buildservice.pm for now. TODO

2. expandMessageTemplateParams( $templateObject, $msgRef )
   This gets the message template (which is a HTML:Template object) and 
   the message parameters. This sub can compute if the template contains
   keys which need to be added to the values hash. 
   The default implementation just returns the original parameter hash 
   because nothing additionally is needed.


差异生成

例如,对于软件包更改,人们通常希望在Hermes通知他们更改的邮件中包含更改的差异。为此,特定消息类型的文本模板只需包含一个名为diff.

  • 参数集合需要包含参数package.spec项目sourcerevision

如果是这种情况,则从OBS API检索差异,并相应地替换文本模板参数diffdiff

请注意,差异大小可能会受到限制,具体取决于Hermes配置变量OBSMaxResponseSize。务必检查这一点。

更多自定义

待完善文档