Go to file
2014-09-25 12:18:20 +00:00
assets feat: Add notification system and docker hook support. 2014-09-21 19:59:47 +00:00
etc feat: Add env configuration sample. 2014-09-23 18:22:13 +00:00
scripts feat: Add build script for bitbucket hub. 2014-09-23 18:20:27 +00:00
src fix: Improve error logs. 2014-09-25 09:42:13 +00:00
.gitignore chore: Update gitignore. 2014-09-23 18:23:55 +00:00
Dockerfile feat: Create docker container. 2014-09-23 18:21:43 +00:00
LICENSE Init. 2014-09-19 18:46:04 +00:00
Makefile chore: Use Makefile to manage docker container. 2014-09-25 12:18:20 +00:00
README.md chore: Complete README. 2014-09-21 20:04:55 +00:00

webhookd

A very simple webhook server to launch shell scripts.

Installation

Linux binaries for release 0.0.1

Download the version you need, untar, and install to your PATH.

$ wget https://github.com/ncarlier/webhookd/releases/download/v0.0.1/webhookd-linux-amd64-v0.0.1.tar.gz
$ tar xvzf webhookd-linux-amd64-v0.0.1.tar.gz
$ ./webhookd

Usage

Create your own scripts template in the scripts directory.

Respect the following structure:

/scripts
|--> /bitbucket
  |--> /echo.sh
  |--> /build.sh
|--> /github
|--> /docker

The directory name right under the scripts directory defined the hookname.

For now, supported hooks are:

  • GitHub
  • Bitbucket
  • Docker Hub

The scripts under the hook directory defined the actions.

The action script take parameters. These parameters are extract from the payload of the hook. For instance the GitHub hook extract the repository URL and name. Then pass them by parameter to the action script.

Check the scripts directory for samples.

Once the action script created, you can trigger the webhook :

$ curl -H "Content-Type: application/json" \
    --data @payload.json \
    http://localhost:8080/<hookname>/<action>

The action script's output is collected and sent by email or by HTTP request.

The HTTP notification need some configuration:

Note that the HTTP notification is compatible with Mailgun API.

As the smtp notification:

  • APP_NOTIFIER=smtp
  • APP_SMTP_NOTIFIER_HOST=localhost:25