diff --git a/app/Dockerfile b/app/Dockerfile index f3c05b3..91a292f 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -68,9 +68,9 @@ EXPOSE 5005 ENTRYPOINT ["/root/entrypoint.sh"] CMD [ "python3", "./server.py" ] -LABEL org.label-schema.build-date=$BUILD_DATE -LABEL org.opencontainers.image.authors="Stefan Allius " + +LABEL org.opencontainers.image.authors="Stefan Allius" LABEL org.opencontainers.image.source https://github.com/s-allius/tsun-gen3-proxy LABEL org.opencontainers.image.description 'The "TSUN Gen3 Micro-Inverter" proxy enables a reliable connection between TSUN third generation inverters and an MQTT broker to integrate the inverter into typical home automations' LABEL org.opencontainers.image.licenses="BSD-3-Clause" -LABEL org.opencontainers.image.vendor="Stefan Allius>" +LABEL org.opencontainers.image.vendor="Stefan Allius" diff --git a/app/build.sh b/app/build.sh new file mode 100755 index 0000000..95adfbb --- /dev/null +++ b/app/build.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +BUILD_DATE=$(date -Iminutes) +VERSION=$(git describe --tags --abbrev=0) +VERSION="${VERSION:1}" +arr=(${VERSION//./ }) +MAJOR=${arr[0]} +echo version: $VERSION build-date: $BUILD_DATE +exec docker build --label "org.label-schema.build-date=${BUILD_DATE}" --label "org.opencontainers.image.version=${VERSION}" \ + -t "ghcr.io/s-allius/tsun-gen3-proxy:latest" -t "ghcr.io/s-allius/tsun-gen3-proxy:${MAJOR}" -t "ghcr.io/s-allius/tsun-gen3-proxy:${VERSION}" app +docker push ghcr.io/s-allius/tsun-gen3-proxy:latest +docker push ghcr.io/s-allius/tsun-gen3-proxy:${MAJOR} +docker push ghcr.io/s-allius/tsun-gen3-proxy:${VERSION} \ No newline at end of file