-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
94 lines (63 loc) · 2.26 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
IMAGE_NAME=bireme/decs-api
APP_VERSION=$(shell git describe --tags --long --always | sed 's/-g[a-z0-9]\{7\}//')
TAG_LATEST=$(IMAGE_NAME):latest
COMPOSE_FILE_DEV=docker-compose-dev.yml
## variable used in docker-compose for tag the build image
export IMAGE_TAG=$(IMAGE_NAME):$(APP_VERSION)
tag:
@echo "IMAGE TAG:" $(IMAGE_TAG)
## docker-compose desenvolvimento
dev_build:
@docker-compose -f $(COMPOSE_FILE_DEV) build
dev_start:
@docker-compose -f $(COMPOSE_FILE_DEV) up -d
dev_start_api:
@docker-compose -f $(COMPOSE_FILE_DEV) up -d decs_api_app
dev_run:
@docker-compose -f $(COMPOSE_FILE_DEV) up
dev_run_api:
@docker-compose -f $(COMPOSE_FILE_DEV) up decs_api
dev_logs:
@docker-compose -f $(COMPOSE_FILE_DEV) logs -f
dev_stop:
@docker-compose -f $(COMPOSE_FILE_DEV) stop
dev_ps:
@docker-compose -f $(COMPOSE_FILE_DEV) ps
dev_rm:
@docker-compose -f $(COMPOSE_FILE_DEV) rm -f
dev_sh:
@docker-compose -f $(COMPOSE_FILE_DEV) exec decs_api_app sh
dev_create_aux_tables:
@docker-compose -f $(COMPOSE_FILE_DEV) exec decs_api_app python manage.py migrate thesaurus
dev_populate_aux_tables:
@docker-compose -f $(COMPOSE_FILE_DEV) exec decs_api_app python manage.py saveauxiliardata
## docker-compose prod
prod_build:
@docker-compose --compatibility build
@docker tag $(IMAGE_TAG) $(TAG_LATEST)
prod_run:
@docker-compose --compatibility up
prod_run_api:
@docker-compose --compatibility up decs_api_app
prod_start:
@docker-compose --compatibility up -d
prod_stop:
@docker-compose --compatibility stop
prod_logs:
@docker-compose --compatibility logs -f
prod_ps:
@docker-compose --compatibility ps
prod_rm:
@docker-compose --compatibility rm -f
prod_sh:
@docker-compose --compatibility exec decs_api_app sh
prod_exec_collectstatic:
@docker-compose --compatibility exec -T decs_api_app python manage.py collectstatic --noinput
prod_make_test:
@docker-compose --compatibility exec -T decs_api_app make test
prod_create_aux_tables:
@docker-compose --compatibility exec decs_api_app python manage.py migrate thesaurus
prod_populate_aux_tables:
@docker-compose --compatibility exec decs_api_app python manage.py saveauxiliardata
prod_create_elasticsearch_indexes:
@docker-compose --compatibility exec decs_api_app python manage.py search_index --rebuild -f --models thesaurus