Only restart gunircorn if templates/packages changed.

This commit is contained in:
Chris GIACOFEI 2024-06-05 11:02:24 -04:00
parent f1f03ee3b6
commit 26a58ff6c8

View File

@ -7,7 +7,7 @@ SHELL := /bin/bash
IGNORE = .git .env
PYFILES := $(filter-out $(IGNORE),$(call rwildcard,.,*.py))
HTMLFILES := $(filter-out $(IGNORE),$(call rwildcard,.,*.html))
$(VENV)/touchfile: requirements.txt
test -d $(VENV) || python3 -m venv $(VENV)
@ -15,7 +15,7 @@ $(VENV)/touchfile: requirements.txt
touch $(VENV)/touchfile
.PHONY: migrate
migrate: ## Make and run migrations
migrate: $(PYFILES) ## Make and run migrations
$(PYTHON) manage.py makemigrations
$(PYTHON) manage.py migrate
$(PYTHON) manage.py collectstatic --noinput
@ -29,7 +29,7 @@ pull:
git pull origin master
.PHONY: start
start: ## Start gunicorn
start: $(HTMLFILES) $(PYFILES) ## Restart gunicorn
sudo systemctl restart gunicorn.service gunicorn.socket
.PHONY: update