forked from zabbix-tooling/k8s-zabbix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
70 lines (54 loc) · 1.52 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
SHELL = bash
activate = source venv/bin/activate
python = python3.11
dockerhub_repo = scoopex666
all: deps
.PHONY: all
deps: venv/bin/activate
.PHONY: deps
venv/bin/activate: requirements.txt
${python} -m venv venv
@# TODO: installation of wheel solves a pip install error, we have to check if that is needed permamently
@# because it seems to be a packaging issue
${activate} && \
pip install wheel && \
pip install -r requirements.txt
clean:
rm -rf venv
.PHONY: clean
check:
@# run sequentially so the output is easier to read
${MAKE} --no-print-directory lint
${MAKE} --no-print-directory type-check
${MAKE} --no-print-directory test
.PHONY: check
lint: deps
${activate} && ${python} -m flake8 base k8sobjects
.PHONY: lint
type-check: deps
${activate} && ${python} -m mypy --no-color-output --pretty base k8sobjects
.PHONY: type-check
test: deps
${activate} && ${python} -m pytest tests
.PHONY: test
run: deps
# refresh token kubeconfig azure access token until kubernetes lib can handle this
kubectl get nodes >/dev/null 2>&1
${activate} && ${python} check_kubernetesd config_flip-dev.ini
.PHONY: run
doc:
cd template && ./create_template_documentation
.PHONY: doc
docker:
./build.sh default ${dockerhub_repo}
.PHONY: docker
publish: docker
./build.sh publish_image ${dockerhub_repo}
.PHONY: publish
release: test doc
[ `git status --porcelain=v1 2>/dev/null | wc -l` -le 0 ]
git commit -a template/custom_service_kubernetes.xml
git push
git push --tags
${MAKE} --no-print-directory publish
.PHONY: release