Skip to content

Instantly share code, notes, and snippets.

@toke
Last active April 26, 2017 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toke/1f4ee47ca0d69971419c2182620bf2d3 to your computer and use it in GitHub Desktop.
Save toke/1f4ee47ca0d69971419c2182620bf2d3 to your computer and use it in GitHub Desktop.
[
{
"id": "github",
"execute-command": "/home/toke/webhooks/hooks/github.sh",
"command-working-directory": "/home/toke/go",
"pass-arguments-to-command":
[
{
"source": "payload",
"name": "head_commit.id"
},
{
"source": "payload",
"name": "pusher.name"
},
{
"source": "payload",
"name": "pusher.email"
}
],
"trigger-rule":
{
"and":
[
{
"match":
{
"type": "payload-hash-sha1",
"secret": "SECRETSECRETSECRET",
"parameter":
{
"source": "header",
"name": "X-Hub-Signature"
}
}
},
{
"match":
{
"type": "value",
"value": "refs/heads/master",
"parameter":
{
"source": "payload",
"name": "ref"
}
}
}
]
}
}
]
server {
# …
location /hooks {
proxy_pass http://127.0.0.1:9000;
proxy_set_header Host $host;
proxy_buffering off;
tcp_nodelay on;
}
}
[program:webhooks]
command=/home/toke/go/bin/webhook -ip 127.0.0.1 -port 9000
directory=/home/toke/webhooks/
environment=HOME="/home/toke",USER="toke"
user=toke
autostart=True
autorestart=True
redirect_stderr=True
priority=90
startsecs=10
startretries=5
stopwaitsecs=20
[Unit]
Description=Webhook
[Service]
User=toke
Group=www-data
Restart=on-failure
WorkingDirectory=/home/toke/webhooks
ExecStart=/home/toke/go/bin/webhook -ip 127.0.0.1 -port 9000
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment