add docker tag function

This commit is contained in:
Simon 2023-08-05 10:26:07 +07:00
parent 59baac2411
commit 985258de20
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4

View File

@ -51,7 +51,8 @@ function sync_test {
}
function sync_docker {
# old local release build
function sync_docker_old {
# check things
if [[ $(git branch --show-current) != 'master' ]]; then
@ -87,6 +88,33 @@ function sync_docker {
}
function sync_docker {
# check things
if [[ $(git branch --show-current) != 'master' ]]; then
echo 'you are not on master, dummy!'
return
fi
echo "latest tags:"
git tag | tail -n 5 | sort -r
printf "\ncreate new version:\n"
read -r VERSION
echo "push new tag: $VERSION?"
read -rn 1
# create release tag
echo "commits since last version:"
git log "$(git describe --tags --abbrev=0)"..HEAD --oneline
git tag -a "$VERSION" -m "new release version $VERSION"
git push origin "$VERSION"
}
if [[ $1 == "validate" ]]; then
validate "$2"
elif [[ $1 == "test" ]]; then