diff --git a/.deploy/run.sh b/.deploy/run.sh deleted file mode 100644 index 73986e8..0000000 --- a/.deploy/run.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -set -e -pushd "$(dirname "$0")/.." -uv run --locked gunicorn surfcamsapi.asgi:application -popd diff --git a/.deploy/surfcams.service b/.deploy/surfcams.service index 08a4c7c..1827791 100644 --- a/.deploy/surfcams.service +++ b/.deploy/surfcams.service @@ -6,7 +6,10 @@ After=nginx.service Type=simple Restart=always RestartSec=1 -ExecStart=/bin/bash /home/anze/projects/surfcams/.deploy/run.sh +WorkingDirectory=/var/apps/surfcams +ExecStart=/var/apps/surfcams/.venv/bin/surfcamsapi.asgi:application +ExecReload=/bin/kill -s HUP $MAINPID +ExecStop=/bin/kill -s TERM $MANPID User=anze [Install] diff --git a/.deploy/update.sh b/.deploy/update.sh index f39de89..1b2f7d4 100644 --- a/.deploy/update.sh +++ b/.deploy/update.sh @@ -5,6 +5,6 @@ git pull uv sync --locked uv run python manage.py collectstatic --noinput uv run python manage.py migrate -ps axf | grep 'gunicorn: master \[surfcams\]' | awk '{print "sudo kill -hup " $1}' | sh +sudo systemctl reload surfcams echo `date "+%Y-%m-%d %H:%M:%S.%3N"` ' Updated' >> update.log popd