-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (32 loc) · 1.18 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
## this is a test make file and is not to be used
SHELL := /bin/bash
include .env
.PHONY: help
help: ## Show this help
@egrep -h '\s##\s' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
.PHONY: venv
venv: ## Make a new virtual environment
python3 -m venv $(VENV)
activate
.PHONY: activate ## activate virtual environment
activate:
eval source $(VENV)/bin/activate
.PHONY: install
install: ## Make venv and install requirements
$(VENV)/bin/pip install wheel
$(VENV)/bin/pip install -r requirements.txt
migrate: ## Make and run migrations
$(PYTHON) manage.py makemigrations
$(PYTHON) manage.py migrate
db-up: ## Pull and start the Docker Postgres container in the background
docker pull postgres
docker-compose up -d
db-shell: ## Access the Postgres Docker database interactively with psql
docker exec -it container_name psql -d $(DBNAME)
.PHONY: test
test: ## Run tests
$(PYTHON) $(APP_DIR)/manage.py test application --verbosity=0 --parallel --failfast
.PHONY: run
run: ## Run the Django server
$(PYTHON) $(APP_DIR)/manage.py runserver
start: install migrate run ## Install requirements, apply migrations, then start development server