diff --git a/.publi.sh b/.publi.sh index 838b7db..bfb6927 100755 --- a/.publi.sh +++ b/.publi.sh @@ -1,17 +1,33 @@ #!/usr/bin/env bash +DOCKERHUB_IMAGE_PATH="bbricardo/fritzinfluxdb" + [[ -z "$1" ]] && echo "please define a version tag" && exit +read -p "Is this a beta (b) release or final (f) release: " -n1 ANSWER && echo + +[[ $ANSWER =~ [bB] ]] && FINAL=false +[[ $ANSWER =~ [fF] ]] && FINAL=true +[[ -z "${FINAL+default}" ]] && echo "Please select 'b' or 'f'." && exit 1 + unset DOCKER_TLS_VERIFY unset DOCKER_HOST unset DOCKER_CERT_PATH docker --config ./docker-tmp login docker --config ./docker-tmp buildx create --use -docker --config ./docker-tmp buildx build --push \ - --platform linux/arm/v7,linux/arm64/v8,linux/amd64 \ - --tag bbricardo/fritzinfluxdb:latest \ - --tag bbricardo/fritzinfluxdb:${1} . +if [[ $FINAL ]]; then + docker --config ./docker-tmp buildx build --push \ + --platform linux/arm/v7,linux/arm64/v8,linux/amd64 \ + --tag ${DOCKERHUB_IMAGE_PATH}:latest \ + --tag ${DOCKERHUB_IMAGE_PATH}:${1} . + [[ $? -ne 0 ]] && exit 1 + which docker-pushrm >/dev/null 2>&1 && docker-pushrm ${DOCKERHUB_IMAGE_PATH}:latest +else + docker --config ./docker-tmp buildx build --push \ + --platform linux/arm/v7,linux/arm64/v8,linux/amd64 \ + --tag ${DOCKERHUB_IMAGE_PATH}:${1} . +fi rm -rf ./docker-tmp diff --git a/README.md b/README.md index b1155a3..d06f808 100644 --- a/README.md +++ b/README.md @@ -203,7 +203,7 @@ See this comment for details: https://github.com/bb-Ricardo/fritzinfluxdb/issues usage: fritzinfluxdb.py [-h] [-c fritzinfluxdb.ini [fritzinfluxdb.ini ...]] [-d] [-v] fritzinfluxdb -Version: 1.0.1-beta2 (2022-08-21) +Version: 1.0.1 (2022-08-22) Project URL: https://github.com/bb-Ricardo/fritzinfluxdb optional arguments: diff --git a/fritzinfluxdb.py b/fritzinfluxdb.py index 3b6c075..5cb403c 100755 --- a/fritzinfluxdb.py +++ b/fritzinfluxdb.py @@ -26,8 +26,8 @@ from fritzinfluxdb.classes.fritzbox.handler import FritzBoxHandler, FritzBoxLuaHandler from fritzinfluxdb.classes.influxdb.handler import InfluxHandler -__version__ = "1.0.1-beta2" -__version_date__ = "2022-08-21" +__version__ = "1.0.1" +__version_date__ = "2022-08-22" __description__ = "fritzinfluxdb" __license__ = "MIT" __url__ = "https://github.com/bb-Ricardo/fritzinfluxdb" diff --git a/fritzinfluxdb/classes/fritzbox/handler.py b/fritzinfluxdb/classes/fritzbox/handler.py index faf7519..a017c06 100644 --- a/fritzinfluxdb/classes/fritzbox/handler.py +++ b/fritzinfluxdb/classes/fritzbox/handler.py @@ -400,7 +400,7 @@ def extract_value(self, service, data, metric_name, metric_params): pass elif data_path is not None: - metric_value = grab(data, data_path) + metric_value = grab(data, data_path, fallback="" if data_path is str else None) # try to add tags if isinstance(data_tags, dict):