🔧 Build frontend on deploy

This commit is contained in:
nikolark committed 2022-02-20 01:16:13 +01:00
1 parent f4749e6a6e
commit 53ef262ba4
3 files changed
+14 -1

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
#!/bin/bash
set -eu
cd frontend
npm i
npm run build
+6 -1
View File
@@ -6,10 +6,15 @@ PROCESS_NAME="bbs.neuf.no"
echo "Deploying bbs to ${PROJECT_PATH}" echo "Deploying bbs to ${PROJECT_PATH}"
cd "$PROJECT_PATH" || exit 1 cd "$PROJECT_PATH" || exit 1
git pull git pull
# Backend
poetry install poetry install
umask 022; poetry run python manage.py collectstatic --noinput # Collect static umask 022; poetry run python manage.py collectstatic --noinput # Collect static
poetry run python manage.py migrate # Run DB migrations poetry run python manage.py migrate # Run DB migrations
# Reload # Frontend
bin/build-frontend
# Reload backend
echo "Reloading supervisor process ${PROCESS_NAME}" echo "Reloading supervisor process ${PROCESS_NAME}"
sudo /usr/bin/supervisorctl pid "$PROCESS_NAME" | xargs kill -HUP sudo /usr/bin/supervisorctl pid "$PROCESS_NAME" | xargs kill -HUP
+3
View File
@@ -1 +1,4 @@
#!/bin/bash
cd frontend && npm run start cd frontend && npm run start