-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
61 lines (52 loc) · 1.68 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
REGISTRY=
REPO=sourcesimian/mqtt-kube
TAG=$(shell cat version)
check:
flake8 ./mqtt_kube --ignore E501
find ./mqtt_kube -name '*.py' \
| xargs pylint -d invalid-name \
-d missing-docstring \
-d too-few-public-methods \
-d line-too-long \
-d too-many-arguments \
-d too-many-instance-attributes \
-d no-self-use
test:
pytest ./tests/ -vvv --junitxml=./reports/unittest-results.xml
docker-armv6:
$(eval REPOTAG := ${REGISTRY}${REPO}:${TAG}-armv6)
docker buildx build \
--platform linux/arm/v6 \
--load \
-t ${REPOTAG} \
-f docker/Dockerfile.alpine \
.
docker-amd64:
$(eval REPOTAG := ${REGISTRY}${REPO}:${TAG}-amd64)
docker buildx build \
--platform linux/amd64 \
--load \
-t ${REPOTAG} \
-f docker/Dockerfile.alpine \
.
push: docker-armv6 docker-amd64
$(eval REPOTAG := ${REGISTRY}${REPO}:${TAG})
$(eval LATEST := ${REGISTRY}${REPO}:latest)
docker push ${REPOTAG}-amd64
docker push ${REPOTAG}-armv6
docker manifest rm ${REPOTAG} &>/dev/null || true
docker manifest create \
${REPOTAG} \
--amend ${REPOTAG}-amd64 \
--amend ${REPOTAG}-armv6
docker manifest push ${REPOTAG}
docker manifest rm ${LATEST} &>/dev/null || true
docker manifest create \
${LATEST} \
--amend ${REPOTAG}-amd64 \
--amend ${REPOTAG}-armv6
docker manifest push ${LATEST}
run-armv6:
docker run -it --rm -p 8080:8080 --volume ${KUBECONFIG}:/kubeconfig --env KUBECONFIG=/kubeconfig ${REGISTRY}${REPO}:${TAG}-armv6
run-amd64:
docker run -it --rm -p 8080:8080 --volume ${KUBECONFIG}:/kubeconfig --env KUBECONFIG=/kubeconfig ${REGISTRY}${REPO}:${TAG}-amd64