Gerrit hooks(钩子集成)
gerrit自身实现了 hooks 机制,不同于原生git的 hooks。
钩子事件类型
文档:https://github.com/GerritCodeReview/plugins\_hooks/blob/master/src/main/resources/Documentation
{gerrit_host}/plugins/hooks/Documentation/hooks.md
- ref-update 和 change-merged 的区别
代码审核通过会触发 change-merged 和 ref-update
直接推送代码到代码库(越过审核)只会触发 ref-update
webhooks
文档:https://github.com/GerritCodeReview/plugins\_webhooks/blob/master/src/main/resources/Documentation
若需要通过钩子机制调用外部的url,则需要另外安装 webhooks
插件。
(可以离线安装,也可以在线安装,在线安装是在web页面操作,需要管理员权限。)
钩子配置
全局钩子需要在 gerrit.config
配置。
项目级钩子通过 REST API 进行增删改查。(需要有项目的Owner权限)
API文档:{gerrit_host}/plugins/webhooks/Documentation/rest-api-config.md
reference:
Gerrit API接入指南
还没有评论,来说两句吧...