-
Notifications
You must be signed in to change notification settings - Fork 38
/
.publi.sh
executable file
·41 lines (33 loc) · 1.27 KB
/
.publi.sh
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
#!/usr/bin/env bash
# Copyright (c) 2022 - 2023 Ricardo Bartels. All rights reserved.
#
# fritzinfluxdb.py
#
# This work is licensed under the terms of the MIT license.
# For a copy, see file LICENSE.txt included in this
# repository or visit: <https://opensource.org/licenses/MIT>.
DOCKERHUB_IMAGE_PATH="bbricardo/fritzinfluxdb"
[[ -z "$1" ]] && echo "please define a version tag" && exit
read -rp "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
if [[ $FINAL == true ]]; 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
# EOF