File tree Expand file tree Collapse file tree 1 file changed +20
-8
lines changed Expand file tree Collapse file tree 1 file changed +20
-8
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
2+ # Wrapper script for bumpversion/bump2version python package.
3+ # Requires: pip install bump2version
4+ #
5+ # Increments major, minor or patch part of version in configured files
6+ # (.bumpversion.cfg). Can be savely executed to see what would be bumped. To
7+ # really change and commit, a second cli arg "doit" has to be passed.
28
39# set -x
4- VERS=$1
5- DRY=" echo"
10+ PART=$1
11+
12+ which bump2version
13+ if [ $? != 0 ]; then
14+ echo " bump2version package missing."
15+ exit 1
16+ fi
617
718if [ -z $1 ]; then
8- echo " Usage: ./bump.sh <version> [doit]"
19+ echo " Bumps version, commits and tags."
20+ echo " Usage: $0 <major|minor|patch> [doit]"
921 exit 0
1022fi
1123
1224if [[ " $2 " == " doit" ]]; then
13- DRY=" "
25+ bumpversion $PART --verbose
26+ echo " "
27+ echo " All good? Then push commits and tags:"
28+ echo " git push --follow-tags"
1429else
1530 echo -e " \nTHIS IS A DRY-RUN\n"
31+ bumpversion $PART --verbose --dry-run
1632fi
17-
18- $DRY git tag -d $VERS
19- $DRY git push origin --delete $VERS
20- $DRY bump2version build --new-version $VERS --commit --tag --verbose
You can’t perform that action at this time.
0 commit comments