-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
69 lines (59 loc) · 1.65 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
webhookName := semgr8s
image := $(shell yq e '.deployment.image.repository' charts/semgr8s/values.yaml)
version := $(shell yq e '.appVersion' charts/semgr8s/Chart.yaml)
tag := $(image):v$(version)
ns := semgr8ns
all: uninstall install
.PHONY:build
build:
@echo "####################"
@echo "## $(@)"
@echo "####################"
docker buildx build --platform=linux/amd64 -t $(tag) -f build/Dockerfile .
.PHONY:build-tester
build-tester:
@echo "####################"
@echo "## $(@)"
@echo "####################"
docker buildx build --platform=linux/amd64 --target tester -t $(tag)-tester -f build/Dockerfile .
.PHONY:push
push:
@echo "####################"
@echo "## $(@)"
@echo "####################"
docker push $(tag)
.PHONY:install
install:
@echo "####################"
@echo "## $(@)"
@echo "####################"
helm install semgr8s charts/semgr8s --atomic --create-namespace --namespace $(ns)
.PHONY:uninstall
uninstall:
@echo "####################"
@echo "## $(@)"
@echo "####################"
helm uninstall semgr8s -n $(ns)
.PHONY:annihilate
annihilate:
@echo "####################"
@echo "## $(@)"
@echo "####################"
helm uninstall semgr8s -n $(ns)
kubectl delete ns $(ns)
.PHONY: test
test:
@echo "####################"
@echo "## $(@)"
@echo "####################"
-kubectl create -f tests/demo
@echo
-kubectl get pods -n test-semgr8s
@echo
-kubectl delete -f tests/demo
.PHONY: unittest
unittest:
@echo "####################"
@echo "## $(@)"
@echo "####################"
docker run --rm -t -v ${PWD}/tests/:/app/tests/ $(tag)-tester pytest --cov=semgr8s --cov-report term-missing tests/