From 53ef262ba4813a67b9b3cc31ad3df817e2fba280 Mon Sep 17 00:00:00 2001 From: Nikolai R Kristiansen Date: Sun, 20 Feb 2022 01:16:13 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Build=20frontend=20on=20deploy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/build-frontend | 5 +++++ bin/deploy | 7 ++++++- bin/run-frontend | 3 +++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100755 bin/build-frontend diff --git a/bin/build-frontend b/bin/build-frontend new file mode 100755 index 0000000..bc50c4a --- /dev/null +++ b/bin/build-frontend @@ -0,0 +1,5 @@ +#!/bin/bash +set -eu +cd frontend +npm i +npm run build diff --git a/bin/deploy b/bin/deploy index 4edaa2b..ba7568a 100755 --- a/bin/deploy +++ b/bin/deploy @@ -6,10 +6,15 @@ PROCESS_NAME="bbs.neuf.no" echo "Deploying bbs to ${PROJECT_PATH}" cd "$PROJECT_PATH" || exit 1 git pull + +# Backend poetry install umask 022; poetry run python manage.py collectstatic --noinput # Collect static poetry run python manage.py migrate # Run DB migrations -# Reload +# Frontend +bin/build-frontend + +# Reload backend echo "Reloading supervisor process ${PROCESS_NAME}" sudo /usr/bin/supervisorctl pid "$PROCESS_NAME" | xargs kill -HUP diff --git a/bin/run-frontend b/bin/run-frontend index 1ea819e..959292f 100755 --- a/bin/run-frontend +++ b/bin/run-frontend @@ -1 +1,4 @@ +#!/bin/bash + cd frontend && npm run start +