i would like to setup auto deployment script to my testing server locally.
i'm using gitolite on ubuntu desktop 11.04.
i install gitolite using apt-get install gitolite, so it is create user gitolite and group gitolite.
Now i setup my testing webserver using apache which has user and group ivan:ivan,
and do git clone under that username.
so all the files and folder have the same file owner ivan:ivan.
i setup post-receive hooks under /var/lib/gitolite/repository/testrepo/hooks/ and have this script inside:
#!/bin/bash
#CONFIG
LIVE="/home/ivan/public_html/testrepo"
read oldrev newrev refname
if [ $refname = "refs/heads/master" ]; then
echo "===== DEPLOYING TO TEST SITE ====="
unset GIT_DIR
cd $LIVE
git pull origin master:
echo "===== DONE ====="
fi
Since post-receive hooks is executed by gitolite user, it has permission problem to access to the test server which is using user ivan.
i already add gitolite to ivan group and make it group access write, but still it cannot run.
i know this is a permission problem, but i don't know the solution.
If you have same experience or got any tips, i would really appreciate it.
Thanks
Ivan