使用场景

  • 团队中有人新建了issue,需要消息提醒。
  • 有人发表了评论,需要消息提醒。
  • 有人在分支上push了新版本的代码…..

总之就是只要有人在GitLab上有任何新的操作动态,即时向MatterMost的指定频道发送消息。通知到团队里的其他人。

操作步骤

MatterMost的群组里创建新的webhook

从菜单选择集成->Incoming Webhooks->Add,添加新的webhook
image.png
点击保存后会生成新的API接口链接,复制该链接。

在GitLab里进行MatterMost Notification的设置

Settings->Intergrations->MatterMost Notification进入以下设置界面。
image.png

  • Webhook:填写在MatterMost里创建的webhook链接。
  • Username:发送消息的主体名称。

点击Test settings测试通过之后,点击绿色按钮Save changes即可保存设置。

如果测试成功,则会收到如下的类似消息。
image.png
注意点
为了显示自定义的消息发送者名称和头像,需要找系统管理员在MatterMost里将以下两个属性值设置为true

  • Enable integrations to override usernames
  • Enable integrations to override profile picture icons

参考文档:MatterMost官方文档