Update the Makefile
This commit is contained in:
parent
cd268dcb39
commit
b98b860078
27
Makefile
27
Makefile
|
@ -1,16 +1,14 @@
|
||||||
SHELL=/bin/bash
|
SHELL=/usr/bin/env bash
|
||||||
|
|
||||||
.PHONY: run
|
.PHONY: run
|
||||||
|
|
||||||
run: venv/production
|
run: venv
|
||||||
( \
|
( \
|
||||||
source venv/bin/activate; \
|
|
||||||
./run.sh; \
|
./run.sh; \
|
||||||
)
|
)
|
||||||
|
|
||||||
test: venv/development
|
test: venv
|
||||||
( \
|
( \
|
||||||
source venv/bin/activate; \
|
|
||||||
export DJANGO_SETTINGS_MODULE=sensors.settings.production; \
|
export DJANGO_SETTINGS_MODULE=sensors.settings.production; \
|
||||||
pytest --nomigrations --cov=. --cov-report=html sensors/; \
|
pytest --nomigrations --cov=. --cov-report=html sensors/; \
|
||||||
)
|
)
|
||||||
|
@ -21,23 +19,10 @@ migrations:
|
||||||
./manage.py makemigrations collector; \
|
./manage.py makemigrations collector; \
|
||||||
)
|
)
|
||||||
|
|
||||||
venv/development:
|
venv:
|
||||||
test -d venv || python3 -m venv venv --system-site-packages
|
nix build .#venv -o venv
|
||||||
( \
|
|
||||||
source venv/bin/activate; \
|
|
||||||
pip3 install -r requirements/development.txt; \
|
|
||||||
)
|
|
||||||
touch venv/development
|
|
||||||
|
|
||||||
venv/production:
|
|
||||||
test -d venv || python3 -m venv venv --system-site-packages
|
|
||||||
( \
|
|
||||||
source venv/bin/activate; \
|
|
||||||
pip3 install -Ur requirements/production.txt; \
|
|
||||||
touch venv/bin/activate: \
|
|
||||||
)
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf venv/
|
rm venv
|
||||||
find . \( -name __pycache__ -o -name "*.pyc" \) -delete
|
find . \( -name __pycache__ -o -name "*.pyc" \) -delete
|
||||||
rm -rf htmlcov/
|
rm -rf htmlcov/
|
||||||
|
|
Loading…
Reference in New Issue