-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
87 lines (62 loc) · 2.44 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
# deploy to Kubernetes
deploy_api:
kubectl apply -f deployments/api/deployment.yaml
kubectl apply -f deployments/api/service.yaml
deploy_web:
kubectl apply -f deployments/web/deployment.yaml
kubectl apply -f deployments/web/service.yaml
deploy_htmltoimage:
kubectl apply -f deployments/htmltoimage/deployment.yaml
kubectl apply -f deployments/htmltoimage/service.yaml
deploy_facedetect:
kubectl apply -f deployments/facedetect/deployment.yaml
kubectl apply -f deployments/facedetect/service.yaml
deploy_sessions:
kubectl apply -f deployments/sessions/deployment.yaml
kubectl apply -f deployments/sessions/service.yaml
deploy_db:
kubectl apply -f deployments/db/volume.yaml
kubectl apply -f deployments/db/deployment.yaml
kubectl apply -f deployments/db/service.yaml
deploy: deploy_db deploy_sessions deploy_facedetect deploy_htmltoimage deploy_web deploy_api
# build docker images
build_api:
docker build -t livelance/api:v0.0.1 services/api
build_web:
docker build -t livelance/web:v0.0.1 services/web
build_htmltoimage:
docker build -t livelance/htmltoimage:v0.0.1 services/htmlToimage
build_facedetect:
docker build -t livelance/facedetect:v0.0.1 services/facedetect
build_sessions:
docker build -t livelance/sessions:v0.0.1 services/sessions
build: build_api build_web build_htmltoimage build_facedetect build_sessions
# compile proto bufers
proto_api:
protoc --proto_path=$(GOPATH)/src:. --micro_out=. --go_out=. services/api/proto/api.proto
proto_htmltoimage:
protoc --proto_path=$(GOPATH)/src:. --micro_out=. --go_out=. services/htmlToimage/proto/htmlToimage.proto
proto_sessions:
protoc --proto_path=$(GOPATH)/src:. --micro_out=. --go_out=. services/sessions/proto/session.proto
proto_web:
protoc --proto_path=$(GOPATH)/src:. --micro_out=. --go_out=. services/web/proto/web.proto
proto: proto_api proto_htmltoimage proto_sessions proto_web
# ensure dependencies
dep_api:
cd services/api && dep ensure
dep_web:
cd services/web && dep ensure
dep_htmltoimage:
cd services/htmlToimage && dep ensure
dep_sessions:
cd services/sessions && dep ensure
dep: dep_api dep_web dep_htmltoimage dep_sessions
# clean unused docker images and containers
clean:
@echo "Remove all non running containers"
-docker rm `docker ps -q -f status=exited`
@echo "Delete all untagged/dangling (<none>) images"
-docker rmi `docker images -q -f dangling=true`
# run docker-compose
up:
docker-compose up