new: Added a dev tag option

This commit is contained in:
SinTan1729 2024-03-23 16:07:55 -05:00
parent cde3fb4c89
commit 8dbb6e9bd6
No known key found for this signature in database
GPG Key ID: EB3E68BFBA25C85F

View File

@ -1,21 +1,28 @@
#!/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 build -t $name .
for tag in $v_major $v_minor $v_patch latest
do
docker tag $name sintan1729/$name:$tag
done
done
echo "Do you want to push these to Docker Hub?"
select yn in "Yes" "No";
do
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
@ -25,5 +32,6 @@ do
echo "Okay! Not pushing."
fi
break
done
done
fi