-
Notifications
You must be signed in to change notification settings - Fork 78
/
Copy pathMakefile
45 lines (41 loc) · 928 Bytes
/
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
WHATEVER := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
$(eval $(WHATEVER):;@:)
# ^ Captures all the stuff passed after the target. If you are going
# to pass options, you may do so by using "--" e.g.:
# make up -- --build
file = docker/dev/docker-compose.yml
ifeq (${CONTEXT}, production)
file = docker/prod/docker-compose.yml
endif
project = sozluk
cc = docker compose -p $(project) -f $(file)
ex = docker exec -it sozluk-web
dj = $(ex) python manage.py
.PHONY: *
.DEFAULT_GOAL := detach
build:
$(cc) build $(WHATEVER)
up:
$(cc) up $(WHATEVER)
detach:
$(cc) up -d $(WHATEVER)
down:
$(cc) down $(WHATEVER)
stop:
$(cc) stop $(WHATEVER)
compose:
$(cc) $(WHATEVER)
logs:
docker logs $(WHATEVER) --tail 500 --follow
console:
$(ex) /bin/bash
run:
$(dj) $(WHATEVER)
shell:
$(dj) shell
test:
$(dj) test --settings=djdict.settings --shuffle --timing --keepdb
format:
pre-commit run
setup:
$(dj) quicksetup