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 1
1
#! /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.
2
8
3
9
# 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
6
17
7
18
if [ -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]"
9
21
exit 0
10
22
fi
11
23
12
24
if [[ " $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"
14
29
else
15
30
echo -e " \nTHIS IS A DRY-RUN\n"
31
+ bumpversion $PART --verbose --dry-run
16
32
fi
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