p-t-a: make the post-update hook a separate file...

...and just refer to it in the doc.  This hook will acquire more code soon,
when we do delegations :)
This commit is contained in:
Sitaram Chamarty 2009-10-02 23:23:52 +05:30
parent 34a6f89c26
commit 5bb0850c5c
2 changed files with 13 additions and 12 deletions

View file

@ -70,20 +70,15 @@ repos they play havoc with my git commands, so this is how I do it)
GIT_WORK_TREE=/home/git/.gitolite git add conf/gitolite.conf keydir GIT_WORK_TREE=/home/git/.gitolite git add conf/gitolite.conf keydir
GIT_WORK_TREE=/home/git/.gitolite git commit -am start GIT_WORK_TREE=/home/git/.gitolite git commit -am start
Now we have to setup the post-update hook for push-to-admin to work. The Now we have to setup the post-update hook for push-to-admin to work. The hook
hook should (1) make a forced checkout in the "live" config directory (which should (1) make a forced checkout in the "live" config directory (which is
is `~/.gitolite`), and (2) run the compile script. So we create a hook with `~/.gitolite`), and (2) run the compile script.
the appropriate code in it, and then make it executable
cat <<EOFPU > hooks/post-update `src/pta-hook.sh` has the code you need; just copy it to the right place with
#!/bin/sh the right name and make sure it is executable:
GIT_WORK_TREE=/home/git/.gitolite git checkout -f
cd /home/git/.gitolite
src/gl-compile-conf
EOFPU
# (assuming pwd is still ~/repositories/gitolite-admin.git)
cp ~/.gitolite/src/pta-hook.sh hooks/post-update
chmod +x hooks/post-update chmod +x hooks/post-update
---- ----

6
src/pta-hook.sh Executable file
View file

@ -0,0 +1,6 @@
#!/bin/sh
GIT_WORK_TREE=/home/git/.gitolite git checkout -f
cd /home/git/.gitolite
src/gl-compile-conf