From 0e39ff9b9d0339eeaaf8bcfa37175b52b60c6bb1 Mon Sep 17 00:00:00 2001 From: Bernhard B Date: Sun, 3 Nov 2019 20:40:25 +0100 Subject: [PATCH] added publish script (to upload images to dockerhub) --- publish.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 publish.sh diff --git a/publish.sh b/publish.sh new file mode 100644 index 0000000..47bc4df --- /dev/null +++ b/publish.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +while getopts v: option +do +case "${option}" +in +v) VERSION=${OPTARG};; +esac +done + +if [ -z "$VERSION" ] +then + echo "Please provide a valid version with the -v flag. e.g: -v 1.0" + exit 1 +fi + +echo "This will upload a new signal-cli-rest-api to dockerhub" +echo "Version: $VERSION" +echo "" + +read -r -p "Are you sure? [y/N] " response +case "$response" in + [yY][eE][sS]|[yY]) + docker buildx build --platform linux/amd64,linux/arm64 -t bbernhard/signal-cli-rest-api:$VERSION . + docker buildx build --platform linux/amd64,linux/arm64 -t bbernhard/signal-cli-rest-api:latest . + ;; + *) + echo "Aborting" + exit 1 + ;; +esac