From 8dbb6e9bd6c83a4e675a59c062a980fa3c06e9ca Mon Sep 17 00:00:00 2001 From: SinTan1729 Date: Sat, 23 Mar 2024 16:07:55 -0500 Subject: [PATCH] new: Added a dev tag option --- docker_push_script.sh | 52 +++++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/docker_push_script.sh b/docker_push_script.sh index 1301374..c3d5156 100755 --- a/docker_push_script.sh +++ b/docker_push_script.sh @@ -1,29 +1,37 @@ #!/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') +if [ "$1" == "dev" ]; then + name="chhoto-url" + docker build -t $name . + docker tag $name sintan1729/$name:dev + docker push sintan1729/$name:dev -name="chhoto-url" +elif [ "$1" == "release" ]; then + 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') -docker build -t $name . + name="chhoto-url" -for tag in $v_major $v_minor $v_patch latest -do - docker tag $name sintan1729/$name:$tag -done + docker build -t $name . -echo "Do you want to push these to Docker Hub?" -select yn in "Yes" "No"; -do - if [ "$yn"="Yes" ]; then - for tag in $v_major $v_minor $v_patch latest - do - docker push sintan1729/$name:$tag - done - else - echo "Okay! Not pushing." - fi - break -done + for tag in $v_major $v_minor $v_patch latest + 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 $v_major $v_minor $v_patch latest + do + docker push sintan1729/$name:$tag + done + else + echo "Okay! Not pushing." + fi + break + done +fi