我的gerrit服务器版本为2.14.7,默认情况下安装了hooks插件。我们的服务器中大约有20个存储库/项目。
当前,我们正在使用预提交钩子。它在本地计算机上运行完美,但是要在Gerrit Server端上的所有gerrit项目中全局运行,我创建了/ opt / gerrrit / hooks /
文件夹然后,我将我的钩子(预提交)重命名为提交接收并更改为可执行文件。并在gerrit.config文件中更新为
[hooks]
path = /opt/gerrit/hooks
但是仍然无法正常工作,而且在error_log中,我没有看到与此钩子相关的任何错误。
我只能看到以下信息。
信息模式:-
[2018-07-18 09:12:09,506] [HTTP-75] INFO com.googlesource.gerrit.plugins.hooks.HookFactory : hooks.path: /opt/gerrit/hooks
[2018-07-18 09:12:09,510] [HTTP-75] INFO com.googlesource.gerrit.plugins.hooks.HookFactory : hooks.refUpdatedHook resolved to /opt/gerrit/hooks/ref-updated
[2018-07-18 09:12:09,552] [HTTP-75] INFO com.googlesource.gerrit.plugins.hooks.HookFactory : hooks.commentAddedHook resolved to /opt/gerrit/hooks/comment-added
[2018-07-18 09:16:47,036] [HTTP-93] INFO com.googlesource.gerrit.plugins.hooks.HookFactory : hooks.submitHook resolved to /opt/gerrit/hooks/submit
[2018-07-18 09:16:47,280] [HTTP-93] INFO com.googlesource.gerrit.plugins.hooks.HookFactory : hooks.changeMergedHook resolved to /opt/gerrit/hooks/change-merged
[2018-07-18 09:20:13,249] [ReceiveCommits-1] INFO com.googlesource.gerrit.plugins.hooks.HookFactory : hooks.commitReceivedHook resolved to /opt/gerrit/hooks/commit-received
[2018-07-18 09:20:13,407] [ReceiveCommits-1] INFO com.googlesource.gerrit.plugins.hooks.HookFactory : hooks.patchsetCreatedHook resolved to /opt/gerrit/hooks/patchset-created
调试模式:-
[2018-07-19 09:10:35,617] [HTTP-134] DEBUG com.googlesource.gerrit.plugins.hooks.HookQueue : Hook file not found: /opt/gerrit/hooks/ref-updated
[2018-07-19 09:10:35,635] [HTTP-134] DEBUG com.googlesource.gerrit.plugins.hooks.HookQueue : Hook file not found: /opt/gerrit/hooks/comment-added
[2018-07-19 09:10:37,004] [HTTP-113] DEBUG com.googlesource.gerrit.plugins.hooks.HookExecutor : Hook file not found: /opt/gerrit/hooks/submit
[2018-07-19 09:10:37,154] [HTTP-113] DEBUG com.googlesource.gerrit.plugins.hooks.HookQueue : Hook file not found: /opt/gerrit/hooks/change-merged
是否需要启用其他设置?金迪建议我。
我的钩子具有项目名称,产品版本,问题ID,开发者名称,测试状态的模板。在本地运行commit命令时。默认情况下,在模板挂钩提示上方。