mirror-chhoto-url/docker_push_script.sh

38 lines
918 B
Bash
Raw Normal View History

#!/bin/env bash
2024-03-23 21:07:55 +00:00
if [ "$1" == "dev" ]; then
name="chhoto-url"
docker build -t $name .
docker tag $name sintan1729/$name:dev
docker push sintan1729/$name:dev
2024-03-23 21:07:55 +00:00
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')
2024-03-23 21:07:55 +00:00
name="chhoto-url"
2024-03-23 21:07:55 +00:00
docker build -t $name .
2024-03-23 21:07:55 +00:00
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