-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (38 loc) · 1.37 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
PROJECT_NAME ?= E-shop
VERSION = $(shell python3.8 setup.py --version | tr '+' '-')
PROJECT_NAMESPACE ?= haraleks
REGISTRY_IMAGE ?= $(PROJECT_NAMESPACE)/$(PROJECT_NAME)
all:
@echo "make dev - Create & run development environment"
@echo "make run - Create & run development environment in terminal (realtime)"
@echo "make migrate - Create and Apply all migrations in django"
@echo "make clean - Clean docker volumes"
@echo "make shell - Start Django shell in terminal"
@echo "make sh - Enter in docker"
@echo "make test - Run tests"
@echo "make stop - Stops docker containers and delete them"
@echo "make clean_images - Clean docker images"
@exit 0
_clean_makefile:
rm -fr *.egg-info dist
_down_docker:
docker-compose down --remove-orphans
clean:
docker volume prune
dev:
docker-compose -f docker-compose.yml up --build -d
run:
docker-compose -f docker-compose.yml up --build --remove-orphans
migrate:
docker-compose exec web python manage.py makemigrations && \
docker-compose exec web python manage.py migrate
shell:
docker-compose exec web python manage.py shell
sh:
docker-compose -f docker-compose.yml exec web sh
stop: _down_docker _clean_makefile
test: start_test_docker stop
start_test_docker:
docker-compose -f docker-compose.yml run web python manage.py test
clean_images:
docker image prune -a -f