My English is not very good. Please bear with me.
I had search this question on stackoverflow and google.But also can't solve this question.
I just want to build a auto deploy enviroment through git hooks.But it's doesn't work.
I use Ubuntu 12.04 server as server on one computer,I call it PC-Ser. And I use a Windows 7 PC as client on other computer,I call it PC-C.
And I install gitolite on PC-Ser with:
- apt-get install gitolite
- addgroup gitolite
- adduser --disabled-password --home /home/gitolite --ingroup gitolite gitolite
- su gitolite
- gl-setup /tmp/user.pub
Then I
"git clone gitolite@PC-Ser:gitolite-admin"
on PC-C.
I create a repo named autoDeploy through edit gitolite.conf file and push it.This is gitolite.conf:
repo gitolite-admin
RW+ = admin
repo autoDeploy
RW+ = @all
After that,I do someting on PC-Ser:
cd /var/www
git clone /home/gitolite/repositories/autoDeploy.git
And then I edit /home/gitolite/repositories/autoDeploy.git/hooks/post-receive:
#!/bin/bash
cd /var/www/autoDeploy
pwd >> /log/pwd.log
git push /home/gitolite/autoDeploy>> /log/push.log 2>&1
echo "finish" >> /log/finish.log
whoami >> /log/user.log
And then, I creat a test.txt on PC-C.autoDeploy and I push it.
But /var/www/autoDeploy have not pulled.It does not work.
There have this on PC-Ser's log:
/log/pwd.log:
/var/www/autoDeploy
/log/push.log:
fatal: Not a git repository: '.'
/log/finish.log:
finish
/log/user.log:
gitolite
I try run the /home/gitolite/repositories/autoDeploy.git/hooks/post-receive by root,it's success,/var/www/autoDeploy has pulled.
Then I "su gitolite" and run /home/gitolite/repositories/autoDeploy.git/hooks/post-receive,it's also success.No error./var/www/autoDeploy has pulled success.
Please help me.Thanks a lot!