mirror of
https://github.com/minoplhy/chhoto-url.git
synced 2024-11-22 09:16:46 +00:00
new: Added a dev tag option
This commit is contained in:
parent
cde3fb4c89
commit
8dbb6e9bd6
@ -1,29 +1,37 @@
|
|||||||
#!/bin/env bash
|
#!/bin/env bash
|
||||||
|
|
||||||
v_patch=$(cat actix/Cargo.toml | sed -rn 's/^version = "(.+)"$/\1/p')
|
if [ "$1" == "dev" ]; then
|
||||||
v_minor=$(echo $v_patch | sed -rn 's/^(.+\..+)\..+$/\1/p')
|
name="chhoto-url"
|
||||||
v_major=$(echo $v_minor | sed -rn 's/^(.+)\..+$/\1/p')
|
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
|
docker build -t $name .
|
||||||
do
|
|
||||||
docker tag $name sintan1729/$name:$tag
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "Do you want to push these to Docker Hub?"
|
for tag in $v_major $v_minor $v_patch latest
|
||||||
select yn in "Yes" "No";
|
do
|
||||||
do
|
docker tag $name sintan1729/$name:$tag
|
||||||
if [ "$yn"="Yes" ]; then
|
done
|
||||||
for tag in $v_major $v_minor $v_patch latest
|
|
||||||
do
|
echo "Do you want to push these to Docker Hub?"
|
||||||
docker push sintan1729/$name:$tag
|
select yn in "Yes" "No";
|
||||||
done
|
do
|
||||||
else
|
if [ "$yn"="Yes" ]; then
|
||||||
echo "Okay! Not pushing."
|
for tag in $v_major $v_minor $v_patch latest
|
||||||
fi
|
do
|
||||||
break
|
docker push sintan1729/$name:$tag
|
||||||
done
|
done
|
||||||
|
else
|
||||||
|
echo "Okay! Not pushing."
|
||||||
|
fi
|
||||||
|
break
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user