Move readme generator webhook service to its own directory
This commit is contained in:
parent
4b22e40a3b
commit
00a3fbae21
3 changed files with 21 additions and 17 deletions
|
@ -1,16 +0,0 @@
|
|||
[Unit]
|
||||
Description=Auto-README webhook gunicorn daemon
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
PIDFile=/run/gunicorn/autoreadme_webhook-pid
|
||||
User=autoreadme_webhook
|
||||
Group=autoreadme_webhook
|
||||
WorkingDirectory=__PATH_TO_README_GENERATOR__
|
||||
ExecStart=__PATH_TO_README_GENERATOR__/venv/bin/gunicorn -w 4 -b 127.0.0.1:8123 webhook:app
|
||||
ExecReload=/bin/kill -s HUP $MAINPID
|
||||
ExecStop=/bin/kill -s TERM $MAINPID
|
||||
PrivateTmp=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import hashlib
|
||||
import hmac
|
||||
from functools import cache
|
||||
|
@ -9,7 +10,10 @@ from pathlib import Path
|
|||
from git import Actor, Repo
|
||||
from sanic import HTTPResponse, Request, Sanic, response
|
||||
|
||||
from make_readme import generate_READMEs
|
||||
# add apps/tools to sys.path
|
||||
sys.path.insert(0, str(Path(__file__).parent.parent))
|
||||
|
||||
from readme_generator.make_readme import generate_READMEs
|
||||
|
||||
TOOLS_DIR = Path(__file__).resolve().parent.parent
|
||||
|
16
webhooks/webhook.service
Normal file
16
webhooks/webhook.service
Normal file
|
@ -0,0 +1,16 @@
|
|||
[Unit]
|
||||
Description=Auto-README webhook gunicorn daemon
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
PIDFile=/run/gunicorn/apps_webhooks-pid
|
||||
User=apps_webhooks
|
||||
Group=apps_webhooks
|
||||
WorkingDirectory=__PATH_TO_APPS_TOOLS__/webhooks
|
||||
ExecStart=__PATH_TO_APPS_TOOLS__/webhooks/venv/bin/gunicorn -w 4 -b 127.0.0.1:8123 webhook:app
|
||||
ExecReload=/bin/kill -s HUP $MAINPID
|
||||
ExecStop=/bin/kill -s TERM $MAINPID
|
||||
PrivateTmp=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Reference in a new issue