Make `collectstatic` locally and improve deployment

This commit is contained in:
Daniel Egger 2023-01-11 16:28:57 +01:00
parent 6701697556
commit a2b24e4696
3 changed files with 4 additions and 2 deletions

View File

@ -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)" .

View File

@ -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",

View File

@ -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