2017-12-25 21:17:47 +01:00
|
|
|
include Makefile.config
|
|
|
|
-include Makefile.custom.config
|
|
|
|
.SILENT:
|
|
|
|
|
|
|
|
make-p:
|
|
|
|
# Launch all P targets in parallel and exit as soon as one exits.
|
|
|
|
set -m; (for p in $(P); do ($(MAKE) $$p || kill 0)& done; wait)
|
|
|
|
|
2018-01-07 11:44:56 +01:00
|
|
|
init-db:
|
2018-01-20 19:12:34 +01:00
|
|
|
$(FLASK) drop_db
|
2018-01-20 20:05:41 +01:00
|
|
|
$(FLASK) db upgrade --directory $(MIGRATIONS)
|
2018-01-20 19:12:34 +01:00
|
|
|
$(FLASK) init_data
|
2018-01-07 11:44:56 +01:00
|
|
|
|
|
|
|
install: install-client install-python
|
|
|
|
|
|
|
|
install-client:
|
|
|
|
$(NPM) install
|
|
|
|
|
|
|
|
install-python:
|
2018-01-07 18:11:19 +01:00
|
|
|
test -d $(VENV) || virtualenv $(VENV) -p $(PYTHON_VERSION)
|
2018-01-07 11:44:56 +01:00
|
|
|
$(PIP) install -r $(REQUIREMENTS)
|
|
|
|
|
2018-01-14 20:49:35 +01:00
|
|
|
lint-all: lint-python lint-react
|
|
|
|
|
|
|
|
lint-python:
|
2018-01-20 20:05:41 +01:00
|
|
|
$(PYTEST) --flake8 --isort -m "flake8 or isort" mpwo_api --ignore=mpwo_api/migrations
|
2018-01-14 20:49:35 +01:00
|
|
|
|
|
|
|
lint-react:
|
|
|
|
$(NPM) lint
|
|
|
|
|
2018-01-20 19:12:34 +01:00
|
|
|
migrate-db:
|
2018-01-21 17:43:13 +01:00
|
|
|
$(FLASK) db migrate --directory $(MIGRATIONS)
|
2018-01-20 19:12:34 +01:00
|
|
|
|
2017-12-25 21:17:47 +01:00
|
|
|
serve-python:
|
|
|
|
$(FLASK) run --with-threads -h $(HOST) -p $(API_PORT)
|
|
|
|
|
|
|
|
serve-react:
|
|
|
|
$(NPM) start
|
|
|
|
|
|
|
|
serve:
|
|
|
|
$(MAKE) P="serve-react serve-python" make-p
|
2018-01-01 11:10:39 +01:00
|
|
|
|
2018-01-07 11:44:56 +01:00
|
|
|
test-e2e:
|
|
|
|
$(NPM) test
|
|
|
|
|
2018-01-01 11:10:39 +01:00
|
|
|
test-python:
|
2018-01-13 13:00:05 +01:00
|
|
|
$(FLASK) test_local
|
2018-01-20 19:12:34 +01:00
|
|
|
|
|
|
|
upgrade-db:
|
2018-01-20 20:05:41 +01:00
|
|
|
$(FLASK) db upgrade --directory $(MIGRATIONS)
|