From b62c51052488f6b3805c96a31dd4f41e1b1ddf89 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Tue, 22 Oct 2019 21:37:03 +0200 Subject: [PATCH] improve the Makefile The Makefile commands sometimes wheren't working correctly. This changes should help with that. --- Makefile | 14 +++++--------- requirements/production.txt | 1 + 2 files changed, 6 insertions(+), 9 deletions(-) create mode 100644 requirements/production.txt diff --git a/Makefile b/Makefile index 8d29cbb..b8c606d 100644 --- a/Makefile +++ b/Makefile @@ -2,8 +2,9 @@ SHELL=/bin/bash .PHONY: run -run: venv +run: venv/production ( \ + source venv/bin/activate; \ export DJANGO_SETTINGS_MODULE=sensors.settings.production; \ ./sensors/manage.py makemigrations; \ ./sensors/manage.py migrate; \ @@ -25,17 +26,12 @@ venv/development: ) touch venv/development -venv: +venv/production: test -d venv || python3 -m venv venv --system-site-packages ( \ source venv/bin/activate; \ - pip3 install -r requirements/base.txt; \ - ) - -venv/bin/activate: venv - ( \ - source venv/bin/activate; \ - touch venv/bin/activate; \ + pip3 install -Ur requirements/production.txt; \ + touch venv/bin/activate: \ ) clean: diff --git a/requirements/production.txt b/requirements/production.txt new file mode 100644 index 0000000..a3e81b8 --- /dev/null +++ b/requirements/production.txt @@ -0,0 +1 @@ +-r base.txt