use webhook tool

This commit is contained in:
Ulf Gebhardt 2022-01-12 19:43:31 +01:00
parent 125857dd1b
commit df8c6ef8f7
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9
3 changed files with 50 additions and 1 deletions

View File

@ -105,4 +105,43 @@ git config pull.ff only
# Allow nginx configuration and restart for gradido
sudo nano /etc/sudoers.d/gradido
> gradido ALL=(ALL) NOPASSWD: /etc/init.d/nginx start,/etc/init.d/nginx stop,/etc/init.d/nginx restart
sudo chmod a+rw /etc/nginx/sites-enabled
sudo chmod a+rw /etc/nginx/sites-enabled
# Webhooks (optional)
sudo apt install webhook
nano ~/hooks.json
```
[
{
"id": "gradido",
"execute-command": "/home/gradido/gradido/deployment/bare_metal/start.sh",
"command-working-directory": "/home/gradido/gradido/deployment/bare_metal",
"trigger-rule": {
"and": [
{
"match": {
"type": "payload-hash-sha1",
"secret": "secret",
"parameter": {
"source": "header",
"name": "X-Hub-Signature"
}
}
},
{
"match": {
"type": "value",
"value": "refs/heads/new_deployment",
"parameter": {
"source": "payload",
"name": "ref"
}
}
}
]
}
}
]
```
webhook -hooks ~/hooks.json &

View File

@ -70,6 +70,11 @@ server {
proxy_redirect off;
}
# Webhook reverse proxy
location /hooks/ {
proxy_pass http://127.0.0.1:9000/hooks/;
}
# Admin Frontend
location /admin {
proxy_http_version 1.1;

View File

@ -56,6 +56,11 @@ server {
proxy_redirect off;
}
# Webhook reverse proxy
location /hooks/ {
proxy_pass http://127.0.0.1:9000/hooks/;
}
# Admin Frontend
location /admin {
proxy_http_version 1.1;