I\'m wondering is there a simple way to install hooks for certain repo using gitolite_admin.
Let\'s imagine i want to have post-update hook
In addition to sitaram's answer, the recent (August 29th, 2013) commit 62fb31755a formerly introduce repo specific hooks:
it's basically just creating a symlink in
pointing to some file inside/hooks $rc{LOCAL_CODE}/hooks/repo-specific(except the gitolite-admin repo)
You cannot specific a hook for gitolite-admin though.
And you hook is only one of the three following authorized hooks:
pre-receivepost-receivepost-updateThat means you can:
gitolite-admin/hooks/repo-specific/xxgitolite-admin local options on the server.First enable those hooks:
ENABLE => [
# allow repo-specific hooks to be added
# 'repo-specific-hooks',
Then declare the hooks on the server gitolite-admin repo:
gitolite git-config gitolite-options.hook=reponame hookname scriptname
(with a tab or \t between reponame hookname scriptname)
Original answer:
As mention in the gitolite man page on hooks
if you want to install a hook in only a few specific repositories, do it directly on the server.
(otherwise, you would be managing hooks for all git repos through gitolite-admin/common/hooks)
That being said, you could take advantage of VREF in gitolite V3.x, which are update hooks: those can be set for some repos and for some user, like any other rule.
You could then:
VREF script leave a 'flag' (a file) in the appropriate bare git repo being updateddeploy' post-update hook, which would first look for that flag, and if found, deploy the repo (and remove the flag).Again:
gitolite-admin can only be common to all git repos (not what you want)The solution above tries to take those two facts into account to achieve what you are looking for: a deploy script running only for certain repos and managed through the gitolite.conf config file of the gitolite-admin repo.