-
Notifications
You must be signed in to change notification settings - Fork 79
/
Makefile
77 lines (53 loc) · 1.52 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
.PHONY: help
date_tag=$(shell date +%Y%m%d%H%M)
help:
@echo "Type make, then hit tab to see make options"
setup_env:
## Copy but don't overwrite the docker env
cp --update=none docker/docker.env.sample docker/docker.env || true
build:
docker compose build
run:
docker compose up
up:
docker compose up -d
up-services:
docker compose up -d db
down:
docker compose down
shell:
@echo "Opening shell in docker container"
@echo "Use this shell to run python and django commands normally"
@docker compose exec web bash
psql:
@docker compose exec db psql chipy chipy
resetdb:
@docker compose exec db psql chipy chipy -c "drop schema if exists public cascade;"
@docker compose exec db psql chipy chipy -c "create schema public;"
web: run
migrate:
docker compose exec web python manage.py migrate
migrations:
docker compose exec web python manage.py makemigrations
tag:
echo Making tag $(date_tag)
git tag -m $(date_tag) $(date_tag)
test:
docker compose up -d
docker compose exec web python manage.py collectstatic --noinput
docker compose exec web pytest -v chipy_org/ -o cache_dir=/var/app/.my_cache_dir
lint:
docker compose exec web pylint -j 0 chipy_org/
format:
docker compose exec web isort .
docker compose exec web black .
format-check:
docker compose exec web isort --check-only .
docker compose exec web black --diff .
setup: setup_env build
superuser:
docker compose exec web ./manage.py createsuperuser
tail-logs:
docker compose logs -f web
dev-data:
docker compose exec web python manage.py makedevdata