#!/usr/bin/env bash
# Mise à jour du site en production : ./deploy/deploy.sh (depuis /var/www/labelinfo)
set -euo pipefail
cd "$(dirname "$0")/.."
export DJANGO_SETTINGS_MODULE=labelinfo.settings.prod
.venv/bin/pip install -q -r requirements.txt
.venv/bin/python manage.py migrate --noinput
.venv/bin/python manage.py createcachetable
.venv/bin/python manage.py collectstatic --noinput
.venv/bin/python manage.py check --deploy
sudo systemctl restart labelinfo
echo "Déploiement terminé."
