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-06-20 15:27:52 +02:00
|
|
|
build-client:
|
|
|
|
$(NPM) build
|
|
|
|
|
2018-04-10 23:01:40 +02:00
|
|
|
clean-install:
|
2018-04-09 22:09:58 +02:00
|
|
|
rm -fr $(NODE_MODULES)
|
|
|
|
rm -fr $(VENV)
|
|
|
|
|
2019-07-14 14:47:07 +02:00
|
|
|
html:
|
2019-07-14 19:42:40 +02:00
|
|
|
rm -rf docsrc/build
|
|
|
|
$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
|
|
cp -a docsrc/build/html/. docs
|
2019-07-14 14:47:07 +02:00
|
|
|
|
2018-09-09 10:48:32 +02:00
|
|
|
install-db:
|
|
|
|
psql -U postgres -f fittrackee_api/db/create.sql
|
|
|
|
$(FLASK) db upgrade --directory $(MIGRATIONS)
|
2018-11-18 13:55:21 +01:00
|
|
|
$(FLASK) initdata
|
2018-09-09 10:48:32 +02:00
|
|
|
|
2018-01-07 11:44:56 +01:00
|
|
|
init-db:
|
2018-11-18 13:55:21 +01:00
|
|
|
$(FLASK) drop-db
|
2018-01-20 20:05:41 +01:00
|
|
|
$(FLASK) db upgrade --directory $(MIGRATIONS)
|
2018-11-18 13:55:21 +01:00
|
|
|
$(FLASK) initdata
|
2018-01-07 11:44:56 +01:00
|
|
|
|
|
|
|
install: install-client install-python
|
|
|
|
|
|
|
|
install-client:
|
2018-06-20 13:23:47 +02:00
|
|
|
$(NPM) install --prod
|
|
|
|
|
|
|
|
install-client-dev:
|
2018-01-07 11:44:56 +01:00
|
|
|
$(NPM) install
|
|
|
|
|
2018-06-20 13:23:47 +02:00
|
|
|
install-dev: install-client-dev install-python-dev
|
|
|
|
|
|
|
|
install-python: venv
|
|
|
|
$(PIPENV) install --deploy
|
|
|
|
|
|
|
|
install-python-dev: venv
|
|
|
|
$(PIPENV) install --dev
|
2018-01-07 11:44:56 +01:00
|
|
|
|
2018-01-14 20:49:35 +01:00
|
|
|
lint-all: lint-python lint-react
|
|
|
|
|
|
|
|
lint-python:
|
2018-06-07 14:15:27 +02:00
|
|
|
$(PYTEST) --flake8 --isort -m "flake8 or isort" fittrackee_api --ignore=fittrackee_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
|
|
|
|
2019-01-06 16:01:44 +01:00
|
|
|
recalculate:
|
|
|
|
$(FLASK) recalculate
|
|
|
|
|
2018-06-20 15:27:52 +02:00
|
|
|
run:
|
|
|
|
$(MAKE) P="run-server run-client" make-p
|
|
|
|
|
|
|
|
run-client:
|
2018-07-01 15:41:23 +02:00
|
|
|
serve -s fittrackee_client/build -l 3000 >> serve.log 2>&1
|
2018-06-20 15:27:52 +02:00
|
|
|
|
|
|
|
run-server:
|
2018-07-01 15:41:23 +02:00
|
|
|
cd fittrackee_api && $(GUNICORN) -b 127.0.0.1:5000 "fittrackee_api:create_app()" --error-logfile ../gunicorn-error.log
|
2018-06-20 15:27:52 +02: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-05-20 20:30:30 +02:00
|
|
|
test-e2e: init-db
|
2018-01-07 11:44:56 +01:00
|
|
|
$(NPM) test
|
|
|
|
|
2018-01-01 11:10:39 +01:00
|
|
|
test-python:
|
2018-07-04 12:00:34 +02:00
|
|
|
$(PYTEST) fittrackee_api --cov-config .coveragerc --cov=fittrackee_api --cov-report term-missing $(PYTEST_ARGS)
|
2018-05-12 18:21:00 +02:00
|
|
|
|
|
|
|
test-python-xml:
|
2018-06-07 14:15:27 +02:00
|
|
|
$(PYTEST) fittrackee_api --cov-config .coveragerc --cov=fittrackee_api --cov-report xml
|
2018-05-12 18:21:00 +02:00
|
|
|
|
2018-05-14 14:51:03 +02:00
|
|
|
update-cov: test-python-xml
|
2018-05-12 18:21:00 +02:00
|
|
|
$(COV) -r coverage.xml
|
2018-01-20 19:12:34 +01:00
|
|
|
|
|
|
|
upgrade-db:
|
2018-01-20 20:05:41 +01:00
|
|
|
$(FLASK) db upgrade --directory $(MIGRATIONS)
|
2018-06-20 13:23:47 +02:00
|
|
|
|
|
|
|
venv:
|
|
|
|
test -d $(VENV) || pipenv --python $(PYTHON_VERSION)
|