Make publishing docker images easy.
5 files changed, 115 insertions(+), 1 deletions(-)

M dash/Makefile
A => dash/VERSION
M dash/requirements.txt
A => mqtt/Makefile
A => mqtt/VERSION
M dash/Makefile +47 -1
@@ 1,2 1,48 @@ 
+IMAGE := schinckel/fronius-dashboard
+
+.PHONY: release
+
 requirements.txt: poetry.lock pyproject.toml
-	poetry export -o requirements.txt
  No newline at end of file
+	poetry export -o requirements.txt
+
+bump-major:
+	cat VERSION | awk -F. '{print $$1 + 1 ".0.0"}' | tee VERSION
+	
+bump-minor:
+	cat VERSION | awk -F. '{print $$1 "." $$2 + 1  ".0"}' | tee VERSION
+	
+VERSION: app.py templates/* static/* requirements.txt
+	cat VERSION | awk -F. '{print $$1 "." $$2 "." $$3 + 1}' | tee VERSION
+	
+release: Dockerfile VERSION
+	docker buildx build . -t $(IMAGE):armv6 --platform linux/arm/v6 --push
+	docker buildx build . -t $(IMAGE):armv7 --platform linux/arm/v7 --push
+	docker buildx build . -t $(IMAGE):amd64 --platform linux/amd64 --push
+	
+	docker pull $(IMAGE):armv6
+	docker pull $(IMAGE):armv7
+	docker pull $(IMAGE):amd64
+	
+	docker image rm --force $(IMAGE):latest
+	
+	docker manifest create $(IMAGE):latest \
+		$(IMAGE):armv6 \
+		$(IMAGE):armv7 \
+		$(IMAGE):amd64 \
+		--amend
+	
+	docker manifest annotate $(IMAGE):latest $(IMAGE):armv6 --variant v6l
+	docker manifest annotate $(IMAGE):latest $(IMAGE):armv7 --variant v7l
+	
+	docker manifest create $(IMAGE):$(shell cat VERSION) \
+		$(IMAGE):armv6 \
+		$(IMAGE):armv7 \
+		$(IMAGE):amd64 \
+		--amend
+	
+	docker manifest annotate $(IMAGE):$(shell cat VERSION) $(IMAGE):armv6 --variant v6l
+	docker manifest annotate $(IMAGE):$(shell cat VERSION) $(IMAGE):armv7 --variant v7l
+	
+	docker manifest push $(IMAGE):$(shell cat VERSION)
+	docker manifest push $(IMAGE):latest
+	
  No newline at end of file

          
A => dash/VERSION +1 -0
@@ 0,0 1,1 @@ 
+0.4.1

          
M dash/requirements.txt +18 -0
@@ 6,6 6,9 @@ asyncio-mqtt==0.8.0 \
     --hash=sha256:cfd0fdd5cf1a19feab2a5d83dfdcb37962daa198cba96defdc12721f387f8e43
 blinker==1.4; python_full_version >= "3.7.0" \
     --hash=sha256:471aee25f3992bd325afa3772f1063dbdbbca947a041b8b89466dc00d606f8b6
+certifi==2020.12.5; python_version >= "3.6" \
+    --hash=sha256:719a74fb9e33b9bd44cc7f3a8d94bc35e4049deebe19ba7d8e108280cfd59830 \
+    --hash=sha256:1a4995114262bffbc2413b159f2a1a480c969de6e6eb13ee966d470af86af59c
 click==7.1.2; python_full_version >= "3.7.0" \
     --hash=sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc \
     --hash=sha256:d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a

          
@@ 18,12 21,21 @@ h2==4.0.0; python_version >= "3.7" and p
 hpack==4.0.0; python_version >= "3.7" and python_full_version >= "3.7.0" \
     --hash=sha256:84a076fad3dc9a9f8063ccb8041ef100867b1878b25ef0ee63847a5d53818a6c \
     --hash=sha256:fc41de0c63e687ebffde81187a948221294896f6bdc0ae2312708df339430095
+httpcore==0.12.3; python_version >= "3.6" \
+    --hash=sha256:93e822cd16c32016b414b789aeff4e855d0ccbfc51df563ee34d4dbadbb3bcdc \
+    --hash=sha256:37ae835fb370049b2030c3290e12ed298bf1473c41bb72ca4aa78681eba9b7c9
+httpx==0.16.1; python_version >= "3.6" \
+    --hash=sha256:9cffb8ba31fac6536f2c8cde30df859013f59e4bcc5b8d43901cb3654a8e0a5b \
+    --hash=sha256:126424c279c842738805974687e0518a94c7ae8d140cd65b9c4f77ac46ffa537
 hypercorn==0.11.2; python_version >= "3.7" and python_full_version >= "3.7.0" \
     --hash=sha256:8007c10f81566920f8ae12c0e26e146f94ca70506da964b5a727ad610aa1d821 \
     --hash=sha256:5ba1e719c521080abd698ff5781a2331e34ef50fc1c89a50960538115a896a9a
 hyperframe==6.0.0; python_version >= "3.7" and python_full_version >= "3.7.0" \
     --hash=sha256:a51026b1591cac726fc3d0b7994fbc7dc5efab861ef38503face2930fd7b2d34 \
     --hash=sha256:742d2a4bc3152a340a49d59f32e33ec420aa8e7054c1444ef5c7efff255842f1
+idna==3.1; python_version >= "3.6" \
+    --hash=sha256:5205d03e7bcbb919cc9c19885f9920d622ca52448306f2377daede5cf3faac16 \
+    --hash=sha256:c5b02147e01ea9920e6b0a3f1f7bb833612d507592c837a6c49552768f4054e1
 itsdangerous==1.1.0; python_full_version >= "3.7.0" \
     --hash=sha256:b12271b2047cb23eeb98c8b5622e2e5c5e9abd9784a153e9d8ef9cb4dd09d749 \
     --hash=sha256:321b033d07f2a4136d3ec762eac9f16a10ccd60f53c0c91af90217ace7ba1f19

          
@@ 72,6 84,12 @@ priority==1.3.0; python_version >= "3.7"
 quart==0.14.1; python_full_version >= "3.7.0" \
     --hash=sha256:7b13786e07541cc9ce1466fdc6a6ccd5f36eb39118edd25a42d617593cd17707 \
     --hash=sha256:429c5b4ff27e1d2f9ca0aacc38f6aba0ff49b38b815448bf24b613d3de12ea02
+rfc3986==1.4.0; python_version >= "3.6" \
+    --hash=sha256:af9147e9aceda37c91a05f4deb128d4b4b49d6b199775fd2d2927768abdc8f50 \
+    --hash=sha256:112398da31a3344dc25dbf477d8df6cb34f9278a94fee2625d89e4514be8bb9d
+sniffio==1.2.0; python_version >= "3.6" \
+    --hash=sha256:471b71698eac1c2112a40ce2752bb2f4a4814c22a54a3eed3676bc0f5ca9f663 \
+    --hash=sha256:c4666eecec1d3f50960c6bdf61ab7bc350648da6c126e3cf6898d8cd4ddcd3de
 toml==0.10.2; python_version >= "3.7" and python_full_version >= "3.7.0" \
     --hash=sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b \
     --hash=sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f

          
A => mqtt/Makefile +48 -0
@@ 0,0 1,48 @@ 
+IMAGE := schinckel/fronius-mqtt
+
+.PHONY: release
+
+requirements.txt: poetry.lock pyproject.toml
+	poetry export -o requirements.txt
+
+bump-major:
+	cat VERSION | awk -F. '{print $$1 + 1 ".0.0"}' | tee VERSION
+	
+bump-minor:
+	cat VERSION | awk -F. '{print $$1 "." $$2 + 1  ".0"}' | tee VERSION
+	
+VERSION: fronius.py requirements.txt
+	cat VERSION | awk -F. '{print $$1 "." $$2 "." $$3 + 1}' | tee VERSION
+	
+release: Dockerfile VERSION
+	docker buildx build . -t $(IMAGE):armv6 --platform linux/arm/v6 --push
+	docker buildx build . -t $(IMAGE):armv7 --platform linux/arm/v7 --push
+	docker buildx build . -t $(IMAGE):amd64 --platform linux/amd64 --push
+	
+	docker pull $(IMAGE):armv6
+	docker pull $(IMAGE):armv7
+	docker pull $(IMAGE):amd64
+	
+	docker image rm --force $(IMAGE):latest
+	
+	docker manifest create $(IMAGE):latest \
+		$(IMAGE):armv6 \
+		$(IMAGE):armv7 \
+		$(IMAGE):amd64 \
+		--amend
+	
+	docker manifest annotate $(IMAGE):latest $(IMAGE):armv6 --variant v6l
+	docker manifest annotate $(IMAGE):latest $(IMAGE):armv7 --variant v7l
+	
+	docker manifest create $(IMAGE):$(shell cat VERSION) \
+		$(IMAGE):armv6 \
+		$(IMAGE):armv7 \
+		$(IMAGE):amd64 \
+		--amend
+	
+	docker manifest annotate $(IMAGE):$(shell cat VERSION) $(IMAGE):armv6 --variant v6l
+	docker manifest annotate $(IMAGE):$(shell cat VERSION) $(IMAGE):armv7 --variant v7l
+	
+	docker manifest push $(IMAGE):$(shell cat VERSION)
+	docker manifest push $(IMAGE):latest
+	
  No newline at end of file

          
A => mqtt/VERSION +1 -0
@@ 0,0 1,1 @@ 
+0.1.0