So here are the requirements:
I found various hook managers in github, but they all had limitations, or did not have integration with chef. or were client side only. Here are some hook managers i found:
or there were git hooks for chef, like:
so using chef, if i can setup a cookbook, which deploys files across git repos while creating links and changing permissions/ownership, that would do it too.
GitLab Community Edition (CE) is being used for remote repositories
Managing hook scripts is pretty much just writing or linking scripts into each git repository on the server side. http://doc.gitlab.com/ce/hooks/custom_hooks.html shows where to find the repos on your GitLab server, and then use a template
or link
resource to add/remove the hook on each repo. Will probably end up looking something like this:
Dir["/var/opt/gitlab/git-data/repositories/*/*.git"].each do |repo_path|
directory File.join(repo_path, "custom_hooks") do
owner "gitlab" # Maybe? Check what the existing permissions look like.
mode "755"
end
template File.join(repo_path, "custom_hooks", "pre-receive") do
source "pre-receive.erb"
owner "gitlab" # Like above.
mode "755"
end
end