From 9fdb634d71bd6c231f4fa34507a2a75aae3625fb Mon Sep 17 00:00:00 2001 From: SinTan1729 Date: Thu, 7 Mar 2024 14:30:41 -0600 Subject: [PATCH] new: Added a convenience script for publishing --- docker_push_script.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 docker_push_script.sh diff --git a/docker_push_script.sh b/docker_push_script.sh new file mode 100755 index 0000000..7f8bafd --- /dev/null +++ b/docker_push_script.sh @@ -0,0 +1,29 @@ +#!/bin/env bash + +v_patch=$(cat actix/Cargo.toml | sed -rn 's/^version = "(.+)"$/\1/p') +v_minor=$(echo $v_patch | sed -rn 's/^(.+\..+)\..+$/\1/p') +v_major=$(echo $v_minor | sed -rn 's/^(.+)\..+$/\1/p') + +name="chhoto-url" + +docker build -t $name . + +for tag in latest $v_patch $v_minor $v_major; +do + docker tag $name sintan1729/$name:$tag +done + +echo "Do you want to push these to Docker Hub?" +select yn in "Yes" "No"; +do + if [ "$yn" = "Yes" ]; then + for tag in latest $v_patch $v_minor $v_major; + do + docker push sintan1729/$name:$tag + done + else + echo "Okay! Not pushing." + fi + break +done +