forked from codeforpdx/recordexpungPDX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
60 lines (43 loc) · 1.39 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
.PHONY: install run clean
install:
pipenv install
clean:
rm -rf src/backend/*.egg-info
find . -type f -name \*~ | xargs rm
find . -type f -name \*pyc | xargs rm
IMAGES := database_image expungeservice_image webserver_image
STACK_NAME := recordexpungpdx
DB_NAME := record_expunge
DB_CONTAINER_NAME := db
REQUIREMENTS_TXT := src/backend/expungeservice/requirements.txt
dev: $(REQUIREMENTS_TXT) dev_deploy
echo $@
dev_deploy: $(IMAGES) dev_start
echo $@
dev_start:
echo $@
docker stack deploy -c docker-compose.yml -c docker-compose.dev.yml $(STACK_NAME)
dev_stop:
echo $@
docker stack rm $(STACK_NAME)
dev_psql:
docker exec -ti $$(docker ps -qf name=$(DB_CONTAINER_NAME)) psql -U postgres -d $(DB_NAME)
database_image:
docker build --no-cache -t $(STACK_NAME):database config/postgres
expungeservice_image:
docker build --no-cache -t $(STACK_NAME):expungeservice src/backend/expungeservice
webserver_image:
cp -r src/frontend/ config/nginx/frontend
docker build --no-cache -t $(STACK_NAME):webserver config/nginx
rm -rf config/nginx/frontend
dblogs:
docker logs --details -ft $$(docker ps -qf name=$(DB_CONTAINER_NAME))
applogs:
docker logs --details -ft $$(docker ps -qf name=expungeservice)
test:
pipenv run pytest --ignore=src/frontend/
dev_drop_database:
docker volume rm $$(docker volume ls -qf name=$(STACK_NAME))
.PHONY: $(REQUIREMENTS_TXT)
$(REQUIREMENTS_TXT):
pipenv lock -r > $@