-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
56 lines (43 loc) · 1.29 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
VERSION = $(shell poetry version -s)
GITHUBUSER = mazocode
#ARCHS = linux/amd64 linux/arm linux/arm/v6 linux/arm/v7 linux/arm64/v8
ARCHS = linux/amd64 linux/arm/v7 linux/arm64/v8
null =
space = $(null) $(null)
comma = ,
$(ARCHS:%=docker-build-%): docker-build-%: export-requirements
-@docker buildx rm modbus2mqtt-docker-build
@docker buildx create --use --name modbus2mqtt-docker-build
@docker buildx build \
--platform $* \
--output type=docker \
-t modbus2mqtt:$(VERSION) \
-t modbus2mqtt:latest \
.
@docker buildx rm modbus2mqtt-docker-build
docker-build-local: docker-build-linux/amd64
docker-push: export-requirements
@docker login ghcr.io -u $(GITHUBUSER)
-@docker buildx rm modbus2mqtt-docker-build
@docker buildx create --use --name modbus2mqtt-docker-build
@docker buildx build \
--platform $(subst $(space),$(comma),$(ARCHS)) \
--push \
-t ghcr.io/$(GITHUBUSER)/modbus2mqtt:$(VERSION) \
-t ghcr.io/$(GITHUBUSER)/modbus2mqtt:latest \
.
docker-run:
@docker run --rm \
--net host \
--volume ./config.yaml:/config.yaml:ro \
modbus2mqtt
export-requirements:
poetry export -f requirements.txt --output requirements.txt
init-env:
poetry env use $(which python3.11)
check-code:
poetry run pflake8 .
show-dependencies:
poetry show
update-dependencies:
poetry update