如何使用用户插件发送消息到Mattermost

Hirofumi Iwashita
2021-09-01 20:06

Artifactory本身不支持webhook,但如果你想通过创建工件等来触发一些动作,可以使用Artifactory Webhook插件
在这篇文章中,我们将介绍如何向Mattermost它是Slack的克隆版之一。

1.配置入站webhook
关于Slack,它是写在Artifactory Webhook插件但请参考进来的人Mattermost。

2.配置webhook.config.json
urlvalue需要更改为传入Webhooks提供的值。的格式值应指定为“松弛“因为Mattermost和Slack的有效载荷是兼容的。关于其他要素,请参考Artifactory Webhook插件
"人":{
“松弛”:{
:“url http://mattermost: 8065 /钩子 /########-####-####-####-############",
“事件”:[
“execute.pingWebhook”,
“storage.afterCreate”,
“storage.afterDelete”,
“storage.afterMove”,
“storage.afterCopy”,
“storage.afterPropertyCreate”,
“storage.afterPropertyDelete”
],
“格式”:“松弛",
“异步”:假的,
“存储库”:(
“vendor-distributions”




3.拯救webhook。Groovy和webhook.config.json
请保存webhook.groovy而且webhook.config.json在插件目录。权限应该与其他插件相同。

4.重新加载插件
请使用重新加载插件REST API。如果你需要改变webhook.config.json,你可以使用webhookReload方法,用Artifactory Webhook插件

5.确认消息
下面的示例是通过部署发送的node_init.sh文件vendor-distributions存储库。
用户添加图片