Search code examples
gitcontinuous-integrationbuildbot

How to set up git a post-commit hook with buildbot


I have a gitPoller set up to run, every 60 seconds, but would rather use the post-commit hook. I am confused on how to accomplish this. I know that I'm supposed to copy the git_buildbot.py file somewhere, but am not sure exactly where.
Also, I don't know what to write for the post-receive file under git hooks.


Solution

  • Assuming that you have your base Git repository (on your Git server) at /var/git/yourproject, then you would install the git_buildbot.py file in /var/git/yourproject/hooks. Once you place the (correctly edited) git_buildbot.py file into that directory, you should chmod 755 git_buildbot.py to make sure that it's executable (assuming that your Git server is some flavor of Unix/Linux.)

    Once you have done that and tested it, you should probably turn off the gitPoller on your CI server.