|
@ -54,11 +54,12 @@ if [[ ! $changed -eq 0 ]]; then |
|
|
exit 3 |
|
|
exit 3 |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
current_branch=$(git rev-parse --abbrev-ref HEAD) |
|
|
# check if push needed before tagging |
|
|
# check if push needed before tagging |
|
|
push_needed=$(git rev-list --branches --not --remotes | wc -l) |
|
|
push_needed=$(git rev-list --branches --not --remotes | wc -l) |
|
|
if [[ $push_needed -ne 0 ]]; then |
|
|
if [[ $push_needed -ne 0 ]]; then |
|
|
echo 'git push needed' |
|
|
echo 'git push needed' |
|
|
git push --set-upstream origin master |
|
|
|
|
|
|
|
|
git push --set-upstream origin "$current_branch" |
|
|
echo 'git push done' |
|
|
echo 'git push done' |
|
|
echo '-------------' |
|
|
echo '-------------' |
|
|
fi |
|
|
fi |
|
@ -86,7 +87,7 @@ if [[ $VERSION != '0.0.0' ]]; then |
|
|
COMMIT_ID=$(git log --format="%H" -n 1) |
|
|
COMMIT_ID=$(git log --format="%H" -n 1) |
|
|
if [[ $COMMIT_ID == $LAST_TAG ]]; then |
|
|
if [[ $COMMIT_ID == $LAST_TAG ]]; then |
|
|
echo "cannot tag twice the same commit id : $LAST_TAG" |
|
|
echo "cannot tag twice the same commit id : $LAST_TAG" |
|
|
exit -1 |
|
|
|
|
|
|
|
|
exit 1 |
|
|
fi |
|
|
fi |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
@ -145,5 +146,5 @@ git add ${GIT_ROOT_FOLDER}/.semver_git_tag |
|
|
echo "tagging as $TAG ..." |
|
|
echo "tagging as $TAG ..." |
|
|
git commit -am "tagged as ${TAG}" |
|
|
git commit -am "tagged as ${TAG}" |
|
|
git tag $TAG |
|
|
git tag $TAG |
|
|
git push origin master --tags |
|
|
|
|
|
echo done |
|
|
|
|
|
|
|
|
git push origin "$current_branch" --tags |
|
|
|
|
|
echo "done" |