forked from restx/restx
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·41 lines (31 loc) · 832 Bytes
/
release.sh
File metadata and controls
executable file
·41 lines (31 loc) · 832 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
# Stop on errors
set -e
display_usage() {
echo -e "Usage: release.sh <RELEASE_VERSION> <NEXT_DEV_VERSION>"
}
if [ $# -ne 2 ]
then
display_usage
exit 1
fi
RELVERSION=$1
DEVVERSION=$2
pendingChangesInIndex=`git status -s --untracked-files=no | grep "^[^?]" | wc -l | tr -d '[[:space:]]'`
if [ "$pendingChangesInIndex" != "0" ]
then
# Stashing current changes
git stash
fi
./setVersion.sh $RELVERSION
git add . && git commit -m "preparing $RELVERSION"
mvn "-DreleaseVersion=$RELVERSION" "-DdevelopmentVersion=$DEVVERSION" -B release:prepare release:perform
./setVersion.sh $DEVVERSION
git add . && git commit -m "re-snapshoted restx.version property"
if [ "$pendingChangesInIndex" != "0" ]
then
# Stash pop should be made in the end only
git stash pop
fi
echo ""
echo " RESTX Release successful !"