Files
django-postfix-dovecot-api/bin/deploy
T
nikolark b12413ed67 ✨ Modernize bit bit
- bumps
- poetry
- linting
2022-08-07 15:44:40 +02:00

19 lines
532 B
Bash
Executable File

#!/bin/bash
set -eu
export DJANGO_SETTINGS_MODULE=dusken.settings.prod
PROJECT_PATH=/var/www/neuf.no/django-postfix-dovecot-api
PROCESS_NAME="mxapi.neuf.no"
echo "Deploying mxapi to ${PROJECT_PATH}"
cd "$PROJECT_PATH" || exit 1
git pull
poetry install
umask 022; poetry run python manage.py collectstatic --noinput -c # Collect static
poetry run python manage.py migrate # Run DB migrations
# Reload backend
echo "Reloading supervisor process ${PROCESS_NAME}"
sudo /usr/bin/supervisorctl pid "$PROCESS_NAME" | xargs kill -HUP