Automatic GitHub Hook Puller for Easy Deployment

In developing websites I would often find myself committing to its git repository, pushing to GitHub, and then SSH-ing to the web host and manually triggering a pull. While being very tedious it sufficed to get the job done. For months I had vowed to employ GitHub’s post-receive hooks to automatically pull in changes on the deployment location. Well, I finally got around to it: http://gist.github.com/228427

Deploying this is as easy as putting this in hookpuller.py, updating the branches dictionary, running chmod 770 hookpuller.py, and protecting it with simple authentication credentials.

Then in your GitHub project go to the “Service Hooks” sub-page under the “Admin” section and enter the URL to the script.
post-receive-hook

Now whenever you push to GitHub your changes will be instantly pulled onto your deployment server.

Continue reading » · Rating: · Written on: 11-06-09 · No Comments »