Overview

README

This is a simple python webapp which listens for POST hook calls from bitbucket and forwards them on to a local irkerd instance as an appropriately formatted json call.

SETUP

Run this as a simple webserver and point the github webhook or bitbucket's POST hook at the server.

For bitbucket, point the hook at:

http://server:port/bitbucket/project

For github, point the hook at:

http://server:port/github/project

where project is the project name that irker will use to announce commits.

The irker server, port, colour mode (mIRC or none) and channels to announce on can be configured in either the source, or the config file (loaded from the WEBHOOK_CONFIG env variable).

PULL_REQUESTS

To enable pull_request events on the web hook, you need to use the github api to configure a web service hook for this.

To enable the hook, post a suitable request to the github api:

curl -u "<user>"
-d '{ "name": "web",
"active": true, "events": ["pull_request"], "config": { "url": "http://server:port/github/project" }

}' https://api.github.com/repos/<user>/<project>/hooks

To list the enabled hooks, use
curl -u "<user>" https://api.github.com/repos/<user>/<project>/hooks

NB: The github doc examples use "content_type: json". While we do support this, it is not particularly well-tested code yet, so use with caution.

LOGGING OPTIONS

By default, this silently skips any exceptions from malformed posts and so forth.

To log errors more verboses, set LOG_ERRORS in the config file

To log details of requests and messages sent to irker, for debugging and so forth, set LOG_INFO in the config file

Use LOG_FILE to set the output file, if desired