-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
42 lines (32 loc) · 1.04 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
TOP := $(shell pwd)
DOCKER_DIR := $(TOP)/deployments/Docker
VERSION := latest
KUBERNETES_DIR := $(TOP)/deployments/Kubernetes
ISTIO_DIR := $(TOP)/deployments/Istio
TYPE := kubernetes
K8S_DEPLOYMENT := $(KUBERNETES_DIR)/cloud-native-video-process.yaml
ISTIO_DEPLOYMENT := $(ISTIO_DIR)/cloud-native-video-process.yaml
ISTIO_VIRTUAL_SERVICE_DEPLOYMENT := $(ISTIO_DIR)/cloud-native-video-process-istio.yaml
TARGETS := process source
default: deploy
.PHONY: build
build: $(addprefix video-,$(TARGETS))
video-%:
docker build -t $*:$(VERSION) -f $(DOCKER_DIR)/Dockerfile.$* .
.PHONY: k8s-deploy
k8s-deploy:
kubectl apply -f $(K8S_DEPLOYMENT)
.PHONY: k8s-delete
k8s-delete:
kubectl delete -f $(K8S_DEPLOYMENT) || true
.PHONY: istio-deploy
istio-deploy:
kubectl apply -f $(ISTIO_DEPLOYMENT)
kubectl apply -f $(ISTIO_VIRTUAL_SERVICE_DEPLOYMENT)
.PHONY: istio-delete
istio-delete:
kubectl delete -f $(ISTIO_VIRTUAL_SERVICE_DEPLOYMENT) || true
kubectl delete -f $(ISTIO_DEPLOYMENT) || true
.PHONY: distclean
distclean: k8s-delete istio-delete
docker system prune