post-receive hook.

1,734 views
Skip to first unread message

Chester ONeill

unread,
Dec 16, 2013, 1:27:18 PM12/16/13
to bonobo-g...@googlegroups.com
Does bonobo support hooks? I'm trying to write a hook that goes to another repository that is tracking master and pulls latest. Trying to set up an auto-deploy of a website when new code is pushed. My script looks like this. 

#!/bin/sh
read i
echo $i > pushinfo
#only because ive been told I should read stdout first

#now deploy my website
cd C:/Path/To/Site
GIT_DIR='.git'

#lets update
git pull

I get an error
remote: git: 'pull' is not a git command. See 'git --help'.

if I run this with a fetch instead of a pull I get 
remote: fatal: Unable to find remote helper for 'http'

Jakub Chodounský

unread,
Dec 16, 2013, 3:23:38 PM12/16/13
to bonobo-g...@googlegroups.com
Bonobo Git Server itself doesn't provide any interface for adding hooks, but the underlying repositories are stored on the server as the classic bare ones. Therefore, you can add hooks and other functionality as you would normally do on your local git repository, but do it on the server.

Chester ONeill

unread,
Dec 16, 2013, 3:30:25 PM12/16/13
to bonobo-g...@googlegroups.com
I get that. I put my script as post-receive in the hooks directory in the git folder on the server. The script seems to run just fine up until it tries to do the pull/fetch. I included the error messages in my post. I was wondering if this is some sort of issue with the underlying git implementation of the driver in bonobo or is this something I have to fix somehow in my git installation. 

I'm able to run the commands just fine outside of the script which is why I posted here thinking it might be a bug in something happening in bonobo.

Jakub Chodounský

unread,
Dec 16, 2013, 3:37:30 PM12/16/13
to bonobo-g...@googlegroups.com
Maybe the problem could be related to incomplete installation of msysgit on the server that Bonobo Git Server uses (AppData\Git) - it is the copy of bin folder, but lots of other directories from the installation are missing and might be causing the problem. Try to point git installation to a full msysgit one on the disk with setting up the GitPath in your web.config

Chester ONeill

unread,
Dec 16, 2013, 5:13:07 PM12/16/13
to bonobo-g...@googlegroups.com
That was the trick. That along with some changes to config (allow anonymous) got my script going. Thanks. 

elijah....@gmail.com

unread,
Jun 17, 2014, 9:50:20 AM6/17/14
to bonobo-g...@googlegroups.com
Hello,

I'm with similar issue.

I'm using BONOBO with full Git installed and correctly setup at web.config. I have a post-receive hook that works fine when executed directly from bash. 

Hooks are not being fired up from Bonobo, any ideas?

Radoslav Štofko

unread,
Apr 10, 2015, 2:32:18 AM4/10/15
to bonobo-g...@googlegroups.com
Do you have any progress in this issue? You solved it somehow?

Jakub Chodounský

unread,
Apr 13, 2015, 3:21:23 PM4/13/15
to bonobo-g...@googlegroups.com
I just realized that hooks might not be fired up for certain actions from Bonobo as it uses mix of libgit2 and msysgit for certain actions as each one of them supports different actions. Libgit2 is used for example for creating new repositories and that means that any of your hooks defined with msysgit might not be fired. Commits are handled by msysgit, so if you define a hook there, it should be fired.

Radoslav Štofko

unread,
Apr 20, 2015, 6:21:18 AM4/20/15
to bonobo-g...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages