From a2b24e469649060921ed0e9c2c46a547f3771c47 Mon Sep 17 00:00:00 2001 From: Daniel Egger Date: Wed, 11 Jan 2023 16:28:57 +0100 Subject: [PATCH] Make `collectstatic` locally and improve deployment --- caprover_deploy.sh | 2 ++ client/package.json | 2 +- compose/django/docker_start.sh | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/caprover_deploy.sh b/caprover_deploy.sh index 1c7d6f5c..503ff1da 100755 --- a/caprover_deploy.sh +++ b/caprover_deploy.sh @@ -36,6 +36,8 @@ npm run build VITE_LOGOUT_REDIRECT=$LOCAL_LOGOUT VITE_SENTRY_ENV=$LOCAL_SENTRY_ENV +python server/manage.py collectstatic --no-input + # create and push new docker container ## Note that images build with buildx do not appear in your docker images list, therefore the push true must be set docker buildx build --push=true --platform=linux/amd64 -f compose/django/Dockerfile -t "$REPO" -t "$LATEST" -t "$VERSION_TAG" --build-arg VERSION="$VERSION" --build-arg BUILD_TIMESTAMP="$BUILD_TIMESTAMP" --build-arg GIT_COMMIT="$(git log -1 --format=%h)" . diff --git a/client/package.json b/client/package.json index ccdaedef..1f06d7f5 100644 --- a/client/package.json +++ b/client/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "scripts": { "dev": "vite", - "build": "vue-tsc --noEmit && vite build && node versionize && cp ./dist/index.html ../server/vbv_lernwelt/templates/vue/index.html && cp -r ./dist/static/vue ../server/vbv_lernwelt/static/", + "build": "vue-tsc --noEmit && vite build && node versionize && cp ./dist/index.html ../server/vbv_lernwelt/templates/vue/index.html && rm -rf ../server/vbv_lernwelt/static/vue/* && cp -r ./dist/static/vue ../server/vbv_lernwelt/static/", "build:tailwind": "tailwindcss -i tailwind.css -o ../server/vbv_lernwelt/static/css/tailwind.css --minify", "codegen": "graphql-codegen", "test": "vitest run", diff --git a/compose/django/docker_start.sh b/compose/django/docker_start.sh index cc6bffe0..ea492112 100644 --- a/compose/django/docker_start.sh +++ b/compose/django/docker_start.sh @@ -4,7 +4,7 @@ set -o errexit set -o pipefail set -o nounset -python /app/manage.py collectstatic --noinput +python /app/manage.py collectstatic --no-input --no-post-process # TODO remove after stabilisation python /app/manage.py reset_schema