-
Notifications
You must be signed in to change notification settings - Fork 1
/
super-release.sh
executable file
·50 lines (35 loc) · 1.08 KB
/
super-release.sh
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
42
43
44
45
46
47
48
#!/bin/bash -ex
DIR=$(dirname $0)
CLOSE_VERSION="$1"
SNAPSHOT_VERSION="$2"
LOCAL_REPOSITORY=$3
STOP=0
if [ $CLOSE_VERSION == '' ]]; then
STOP=1;
fi;
if [[ $SNAPSHOT_VERSION == '' ]]; then
STOP=1;
fi;
if git status -s | grep ".\\+" ; then
STOP=1;
fi
if [ $STOP -eq 0 ]; then
mvn clean install
fi
if git status -s | grep ".\\+" ; then
STOP=1;
fi
if [ $STOP -eq 0 ]; then
mvn versions:set -DnewVersion=$CLOSE_VERSION
git commit -am "releasing jpa-query-paginator-$CLOSE_VERSION"
git tag jpa-query-paginator-$CLOSE_VERSION
git push origin jpa-query-paginator-$CLOSE_VERSION
mvn clean install -Dmaven.test.skip.exec
mvn deploy -e -Dmaven.test.skip.exec -Dlocal.repository=$LOCAL_REPOSITORY
mvn versions:set -DnewVersion=$SNAPSHOT_VERSION -DgenerateBackupPoms=false
git commit -am "setting next version to releasing jpa-query-paginator-$CLOSE_VERSION"
git push
mvn versions:commit
else
echo "Script usage: $(basename $0) 0.0.1 0.0.2-SNAPSHOT localrepository"
fi