Skip to content
Snippets Groups Projects
Commit c0119c25 authored by Nicolas Dandrimont's avatar Nicolas Dandrimont
Browse files

Refactor local Makefile to run relevant things before tests/devserver

Summary:
The tests now depend on webpack being built, so do that before running make
test.

The devserver depends on migrations being run, so do that as well.

I'm not entirely sure the migration part is the right thing to do, but at least
with the webpack part, running the tests will do reasonable things.

Test Plan: make test still works

Reviewers: anlambert, #reviewers!

Differential Revision: https://forge.softwareheritage.org/D320
parent 2a1768cd
No related branches found
Tags v0.0.124
1 merge request!47Refactor local Makefile to run relevant things before tests/devserver
run-django-webpack-devserver:
.PHONY: build-webpack-dev
build-webpack-dev:
npm run build-dev
.PHONY: build-webpack-prod
build-webpack-prod:
npm run build
.PHONY: run-migrations
run-migrations:
cd swh/web && python3 manage.py migrate
run-django-webpack-devserver: run-migrations
bash -c "trap 'trap - SIGINT SIGTERM ERR; kill %1' SIGINT SIGTERM ERR; npm run start-dev & cd swh/web && python3 manage.py runserver"
run-django-webpack-dev:
npm run build-dev && cd swh/web && python3 manage.py runserver --nostatic
run-django-webpack-dev: build-webpack-dev run-migrations
cd swh/web && python3 manage.py runserver --nostatic
run-django-webpack-prod:
npm run build && cd swh/web && python3 manage.py runserver --nostatic --settings=swh.web.settings.production
run-django-webpack-prod: build-webpack-prod run-migrations
cd swh/web && python3 manage.py runserver --nostatic --settings=swh.web.settings.production
run-django-server-dev:
run-django-server-dev: run-migrations
cd swh/web && python3 manage.py runserver --nostatic
run-django-server-prod:
run-django-server-prod: run-migrations
cd swh/web && python3 manage.py runserver --nostatic --settings=swh.web.settings.production
run-gunicorn-server:
run-gunicorn-server: run-migrations
gunicorn3 -b 127.0.0.1:5004 swh.web.wsgi
test: build-webpack-dev
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment