-
Notifications
You must be signed in to change notification settings - Fork 35
/
release.sh
executable file
·83 lines (70 loc) · 2.04 KB
/
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
#
# JPAstreamer - Express JPA queries with Java Streams
# Copyright (c) 2020-2022, Speedment, Inc. All Rights Reserved.
#
# License: GNU Lesser General Public License (LGPL), version 2.1 or later.
#
# This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Lesser General Public License for more details.
#
# See: https://github.com/speedment/jpa-streamer/blob/master/LICENSE
#
#Fail on any error
set -e
if [ $# -eq 0 ]
then
echo "Usage $0: version [skip]"
exit 1
fi
VERSION=$1
echo "** Checking tool versions"
mvn --version
echo "** Bumping to version $VERSION"
echo "** Checking if we are on the 'develop' branch"
DEVELOP_BRANCH=`git branch | grep "* develop" | wc -l`
if [ "$DEVELOP_BRANCH" -ne 1 ]
then
echo "Not on the 'develop' branch"
exit 1
fi
read -p "Press enter to continue"
echo "** Pulling updates from GitHub"
git pull
echo "** Checking license headers"
mvn -Prelease com.mycila:license-maven-plugin:3.0:format -Plicense-check
if [ "$2" == 'skip' ]
then
echo "** Skipping build of the enterprise project"
else
echo "TODO: Run integration tests"
# echo "** Building the enterprise project"
# cd ../speedment-enterprise
# mvn clean install -Prelease
# cd ../speedment
fi
UPDATED_FILES=`git status | grep -e 'new file:' -e 'modified:' | wc -l`
echo "** There are $UPDATED_FILES files to commit"
if [ "$UPDATED_FILES" -gt 0 ]
then
echo "** Push changes to GitHub"
git add --all
git commit -m "Prepare for version bump to $VERSION"
git push
fi
echo "** Performing checkout master, pull and merge with develop"
git checkout master
git pull
git merge develop
echo "** Setting versions to $VERSION"
./set_version.sh "$VERSION"
mvn speedmentversion:check
echo "** Building version $VERSION"
mvn clean install -Prelease
echo "** Push changes to GitHub"
git add --all
git commit -m "Bump version to $VERSION"
git push
echo "Completed!"
echo "Ready for mvn -Prelease clean deploy"