From 522889208083d21beb66df12f13b99a23f7efd24 Mon Sep 17 00:00:00 2001 From: Thilo Wischmeyer <thwischm@gmail.com> Date: Mon, 9 Nov 2020 15:40:24 +0100 Subject: [PATCH] Made makefile more readable and autodetect if frontend needs to be rebuilt --- Makefile | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 19020257..ba608333 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,9 @@ APP_LIST ?= core grady util DB_NAME = postgres -.PHONY: run install migrations-check isort isort-check test +.ONESHELL: + +.PHONY: run install migrations-check isort isort-check test teste2e run: python manage.py runserver 0.0.0.0:8000 @@ -21,14 +23,19 @@ migrate: test: pytest --ds=grady.settings core/tests -teste2e: - cd frontend && yarn build && cp dist/index.html ../core/templates && cd .. && python util/format_index.py && python manage.py collectstatic --no-input && HEADLESS_TESTS=$(headless) pytest --ds=grady.settings $(path); git checkout core/templates/index.html - -teste2e-nc: - cp frontend/dist/index.html ./core/templates && python util/format_index.py && python manage.py collectstatic --no-input && HEADLESS_TESTS=$(headless) pytest --ds=grady.settings $(path); git checkout core/templates/index.html +frontend/dist: $(shell find frontend/src -type f) + yarn --cwd frontend build +teste2e: frontend/dist + set -e + cp frontend/dist/index.html core/templates + trap "git checkout core/templates/index.html" EXIT + python util/format_index.py + python manage.py collectstatic --no-input + HEADLESS_TESTS=$(headless) pytest --ds=grady.settings $(path) coverage: + set -e DJANGO_SETTINGS_MODULE=grady.settings pytest --cov coverage html -- GitLab