From 985258de2080a39089662ae3cc8a2c658ea0b2a7 Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 5 Aug 2023 10:26:07 +0700 Subject: [PATCH] add docker tag function --- deploy.sh | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/deploy.sh b/deploy.sh index c93f833..8ab1d49 100755 --- a/deploy.sh +++ b/deploy.sh @@ -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