Skip to content

Commit

Permalink
Add fixed version of bump.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
JOJ0 committed Dec 31, 2024
1 parent bc6b472 commit aa1f59b
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions bump.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
#!/bin/bash
# Wrapper script for bumpversion/bump2version python package.
# Requires: pip install bump2version
#
# Increments major, minor or patch part of version in configured files
# (.bumpversion.cfg). Can be savely executed to see what would be bumped. To
# really change and commit, a second cli arg "doit" has to be passed.

#set -x
VERS=$1
DRY="echo"
PART=$1

which bump2version
if [ $? != 0 ]; then
echo "bump2version package missing."
exit 1
fi

if [ -z $1 ]; then
echo "Usage: ./bump.sh <version> [doit]"
echo "Bumps version, commits and tags."
echo "Usage: $0 <major|minor|patch> [doit]"
exit 0
fi

if [[ "$2" == "doit" ]]; then
DRY=""
bumpversion $PART --verbose
echo ""
echo "All good? Then push commits and tags:"
echo "git push --follow-tags"
else
echo -e "\nTHIS IS A DRY-RUN\n"
bumpversion $PART --verbose --dry-run
fi

$DRY git tag -d $VERS
$DRY git push origin --delete $VERS
$DRY bump2version build --new-version $VERS --commit --tag --verbose

0 comments on commit aa1f59b

Please sign in to comment.