服务器端 hooks
Git server hooks
创建全局 Server hooks
https://docs.gitlab.com/ee/administration/server_hooks.html
配置 custom_hooks_dir
vim /etc/gitlab/gitlab.rb # 这个配置已经作废 gitlab_shell['custom_hooks_dir'] = "/opt/gitlab/embedded/service/gitlab-shell/hooks" # 在 gitaly 下面加入配置 gitaly['custom_hooks_dir'] = "/var/opt/gitlab/gitaly/custom_hooks"
mkdir -p /var/opt/gitlab/gitaly/custom_hooks vim /var/opt/gitlab/gitaly/custom_hooks/commit-msg chmod +x /var/opt/gitlab/gitaly/custom_hooks/commit-msg
多个配置可以创建一个 commit-msg.d 目录,然后把多个脚本放入该目录
root@netkiller:/opt/gitlab# mkdir -p /var/opt/gitlab/gitaly/custom_hooks/commit-msg.d root@netkiller:/opt/gitlab# vim /var/