LoadRunner - GitHub Webhook Server and Event Simulator

Gem Version Build Status Maintainability Test Coverage


LoadRunner is a multi-purpose utility for working with GitHub webhooks and statuses.

It provides these features:

  • A webserver that responds to GitHub webhook events and can run any arbitrary script written in any language.
  • A command line utility for testing your webhook server configuration by sending simulated events.
  • A command line utility for sending status updates to pull requests.

Install

$ gem install loadrunner

Getting Started

# Create a sample hook handler
$ mkdir -p handlers/myrepo
$ echo "#\!/usr/bin/env bash" > handlers/myrepo/push
$ echo "echo hello > output.txt" >> handlers/myrepo/push
$ chmod +x handlers/myrepo/push

# Start the server
$ loadrunner server

# In another terminal, send a sample webhook event
$ loadrunner event localhost:3000 myrepo push master

# Verify the handler was executed
$ cat output.txt

For more options, see the documentation or run

$ loadrunner --help

Running with Docker

You can run both the server and the client using Docker.

# Server
$ docker run -p3000:3000 dannyben/loadrunner server

# Client
$ docker run dannyben/loadrunner event http://webhook.server.com/payload repo push

If you wish to connect the client to the server you are running through Docker, you can do something like this:

$ docker run --network host dannyben/loadrunner event http://localhost:3000/payload repo push

See also: The docker-compose file.