I installed Bonobo Git Server on Windows 2008 R2 Server machine. I created a repository and put post-receive.bat
file in D:\Inetpub\Bonobo.Git.Server\App_Data\Repositories\REPO\hooks
directory.
This is the content of the file:
#!/D/Inetpub/Bonobo.Git.Server/App_Data/Git/sh.exe
BINPATH="/D/Inetpub/Bonobo.Git.Server/App_Data/Git/"
REPOPATH="/D/Inetpub/Bonobo.Git.Server/App_Data/Repositories/REPO/"
GIT="${BINPATH}git"
# Change working directory to the repo root
cd $REPOPATH
read oldrev
read newrev
read refname
branch=$($GIT rev-parse --symbolic --abbrev-ref $refname)
if [ "master" == "$branch" ]; then
echo "receive $branch $refname" >> "${REPOPATH}hookstest.log"
fi
If I execute this file from shell and type "whatever whatever master", then the file "receive master master" is added to hookstest.log
. However, when I push changes to REPO the file is not updated, just as if it wasn't executed.
I have no idea where to look for errors that occurred. Most of the linux tutorials mention that the file must have +x flag. This obviously does not exist on Windows, but I checked and the user that runs Bonobo Git Server in IIS has execution rights on the batch file.
I was also hesitating about the name of the file, so I copied it and removed .bat extension. That did not help either. Any idea how I can get the hook working on the Windows Server?
EDIT
As suggested by @crashmstr I created a batch file (one with extension and one without) that contained:
date /t >> D:\Inetpub\Bonobo.Git.Server\App_Data\Repositories\REPO\testhooks.txt
This did not work either, even though the file was created, when I executed the file manually.