Skip to content

Commit

Permalink
feat: tag bash
Browse files Browse the repository at this point in the history
  • Loading branch information
pnoker committed Jun 21, 2022
1 parent fa17c4e commit 01814dd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 38 deletions.
27 changes: 0 additions & 27 deletions dc3/git/git-tag-develop.sh

This file was deleted.

29 changes: 18 additions & 11 deletions dc3/git/git-tag-release.sh → dc3/git/tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,25 @@ set -e

cd ../../

git checkout master
git merge develop
type=""

git pull --tags
# shellcheck disable=SC2116
# shellcheck disable=SC2046
release_tag=$(echo dc3.release.$(date +'%Y%m%d').$(git tag -l "dc3.release.$(date +'%Y%m%d').*" | wc -l | xargs printf '%02d'))
echo "${release_tag}"
git tag "${release_tag}"

git push origin --tags
if `git status | grep "develop" &>/dev/null`; then
type="develop"
fi
if `git status | grep "release" &>/dev/null`; then
type="release"
fi
if [[ ${type} == "" ]]; then
echo -e "This branch doesn't support tagging, please switch to the \033[31mdevelop\033[0m or \033[31mrelease\033[0m branch."
exit
fi

git checkout develop

git pull --tags
# shellcheck disable=SC2046
# shellcheck disable=SC2116
tag=$(echo dc3.${type}.$(date +'%Y%m%d').$(git tag -l "dc3.${type}.$(date +'%Y%m%d').*" | wc -l | xargs printf '%02d'))
echo "${tag}"
git tag "${tag}"

git push origin --tags

0 comments on commit 01814dd

Please sign in to comment.