-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (37 loc) · 1.11 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
PWD = $(shell pwd)
home = $(shell )
cluster_name = $(or $(shell printenv KIND_CLUSTER), local-sandbox)
dev_toolbox = k8s-value-scanner-dev
.SILENT: .use-context-kind
.PHONY: .use-context-kind
.use-context-kind:
kubectl config use-context kind-$(cluster_name)
.PHONY: kind-create
kind-create:
kind \
create \
cluster \
--name $(cluster_name) \
--config kind-k8s/kind.conf
$(MAKE) .use-context-kind
.PHONY: kind-delete
kind-delete:
kind \
delete \
cluster \
--name $(cluster_name)
.PHONY: .build-dev-toolbox
.build-dev-toolbox:
docker build -t $(dev_toolbox) -f toolbox/Dockerfile.dev ./toolbox
.PHONY: dev-toolbox
dev-toolbox: .build-dev-toolbox
docker run --rm -d -v $(PWD)/:/code --network=host --name $(dev_toolbox) $(dev_toolbox) tail -f /dev/null
docker exec $(dev_toolbox) mkdir -p /home/gopher/.kube
docker cp $(HOME)/.kube/config $(dev_toolbox):/home/gopher/.kube/config
docker exec -ti $(dev_toolbox) bash
.PHONY: dev-toolbox-destroy
dev-toolbox-destroy:
docker stop $(dev_toolbox)
.PHONY: apply-test-manifests
apply-test-manifests:
kubectl apply -f test-manifests