Easily Integrate a GitHub Repository with Redmine using The GitHub Hook Plugin

Back in April, I explained how to use a GitHub repository with Redmine using Cron. If that seemed complicated, do not worry, there is now an easier way. I was recently asked for my opinion on a Redmine plugin called GitHub Hook.

How this plugin works is simple. After installing the plugin, just clone the GitHub repository like normal and setup Redmine to use that repository. Next, you simply create a new Post-Receive hook in your project’s Admin tab on GitHub. After that is done, you are good to go. Now every time a commit is pushed to the GitHub repository, GitHub will send a notification to Redmine and the git repository on your server will be updated.

I thought I would test this plugin with WicketPixie. I had already been using the cron approach I had described, and this plugin seemed to greatly simplify the process. First, on my server, I entered the vendor/plugins directory of my Redmine installation and cloned the GitHub Hook plugin from GitHub:

1
2
cd /home/eddie/app/redmine/vendor/plugins
git clone git://github.com/koppen/redmine_github_hook.git

Next I followed the standard Redmine plugin installation procedures and restarted my Rails server:

1
2
sudo service thin restart
sudo service nginx restart

Those four lines are the only commands you will need to enter into a console to setup this plugin, but I still need to clone the WicketPixie repository:

1
2
3
mkdir /home/eddie/app/redmine/repositories
cd /home/eddie/app/redmine/repositories
git clone git://github.com/eddieringle/wicketpixie.git

After that, I set Redmine to use that repository for the WicketPixie project:set_redmine_repository
Now all that is left to do is adding the Post-Receive URL on GitHub. GitHub has a nice guide on how to add Post-Receive URLs. The URL is <redmineurl>/github_hook. So if my Redmine site is at code.idlesoft.net, then I would enter code.idlesoft.net/github_hook as the URL.

Now you are setup, go ahead and commit to your project and make sure that the repository updated on Redmine. Thanks to Jakob Skjerning for writing this plugin and making GitHub integration with Redmine easier!

2 Comments

I can’t follow you. When I run line:
$ git clone github.com/eddieringle/wicketpixie.git
I receive:
Initialized empty Git repository in /var/www/html/redmine/redmine-0.8.7/vendor/plugins/redmine_github_hook/.git/
github.com[0: 207.97.227.239]: errno=Connection timed out
fatal: unable to connect a socket (Connection timed out)
I don’t know how the way to config error.

Works fine here, check your network connection.

Leave a Comment