forked from realsuayip/django-sozluk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (45 loc) · 1023 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
46
47
48
49
50
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
# DEV FILE :
#file = docker/docker-compose.dev.yml
file = docker/docker-compose.yml
## OMIT THIS CONDITIONAL
#
#ifeq (${CONTEXT}, production)
# file = docker/docker-compose.yml
#endif
project = sozluk
cc = docker compose -p $(project) -f $(file)
ex = docker exec -it sozluk_backend
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:
$(ex) sh ./docker/scripts/setup.sh