Add backup/restore to makefile.

This commit is contained in:
Chris GIACOFEI 2024-06-05 10:54:33 -04:00
parent 12763925ed
commit f1f03ee3b6

View File

@ -14,9 +14,6 @@ $(VENV)/touchfile: requirements.txt
$(BIN)/pip install --upgrade -r requirements.txt
touch $(VENV)/touchfile
.PHONY: install
install: $(VENV)/touchfile ## Make venv and install requirements
.PHONY: migrate
migrate: ## Make and run migrations
$(PYTHON) manage.py makemigrations
@ -36,7 +33,15 @@ start: ## Start gunicorn
sudo systemctl restart gunicorn.service gunicorn.socket
.PHONY: update
update: pull install migrate start
update: pull $(VENV)/touchfile migrate start ## Pull latest from remote and restart
.PHONY: backup
backup: ## Backup database to json file.
$(PYTHON) manage.py dumpdata --exclude auth.permission --exclude contenttypes --indent=2 > db.json
.PHONY: restore
restore: ## Restore previous backup file.
$(PYTHON) manage.py loaddata db.json
.PHONY: clean
clean: