How to use post-receive hook after git push to gitolite server?

2.5k Views Asked by At

I tried to use post-receive hook to make a new build on Jenkins after every push to the gitolite server, BUT it doesn't work automatically after push and I need to execute post-receive file manually by terminal to run it and make a build on Jenkins.

AFAIK, all I need is to:

  1. Modify the post-receive file on server to make what I want "make a new build in Jenkins".

  2. Push code to the gitolite server by command "git push".

and the post-receive hook will execute automatically after push process, Am I right ?

1

There are 1 best solutions below

0
On

Make shure that the file has the execute bit set and that it belongs to the gitolite user. Also make shure to call each command from there with its full path as PATH is limited while executing the hook.