mirror of
https://github.com/minoplhy/chhoto-url.git
synced 2024-11-22 09:16:46 +00:00
30 lines
637 B
Bash
Executable File
30 lines
637 B
Bash
Executable File
#!/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 $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
|
|
|