forked from estatio/estatio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.sh
79 lines (61 loc) · 1.98 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
# fail fast
#set -e
NO_SANITY_CHECK=0
while getopts "xj:r:s:" OPT; do
case "$OPT" in
x) NO_SANITY_CHECK=1
;;
j) JIRA=$OPTARG
;;
r) RELEASE_VERSION=$OPTARG
;;
s) SNAPSHOT_VERSION=$OPTARG
;;
esac
done
shift $((OPTIND-1))
if [ ! "$JIRA" -o ! "$RELEASE_VERSION" -o ! "$SNAPSHOT_VERSION" ]; then
echo "usage: $(basename $0) [-x] -j [jira] -r [release_version] -s [snapshot_version]" >&2
echo " eg: $(basename $0) -j EST-1234 -r 1.6.0 -s 1.7.0-SNAPSHOT" >&2
exit 1
fi
echo "\$JIRA = $JIRA"
echo "\$RELEASE_VERSION = $RELEASE_VERSION"
echo "\$SNAPSHOT_VERSION = $SNAPSHOT_VERSION"
echo "\$NO_SANITY_CHECK = $NO_SANITY_CHECK"
echo ""
echo "sanity check (mvn clean install -T1C -o)"
echo ""
if [ $NO_SANITY_CHECK == 0 ]; then
mvn clean install -T1C -o || exit 1 >/dev/null
else
echo "... skipped"
fi
echo ""
echo "bumping version to $RELEASE_VERSION"
echo ""
mvn versions:set -DnewVersion=$RELEASE_VERSION -DgenerateBackupPoms=false || exit 1 > /dev/null
echo "Committing changes"
git commit -am "$JIRA: bumping to release $RELEASE_VERSION" || exit 1
echo "Tagging"
git tag $RELEASE_VERSION || exit 1
echo ""
echo "building release locally"
echo ""
rm -Rf ~/.m2/repository/org/incode/module/base/
rm -Rf ~/.m2/repository/org/incode/module/classification/
rm -Rf ~/.m2/repository/org/incode/module/communications/
rm -Rf ~/.m2/repository/org/incode/module/documents/
rm -Rf ~/.m2/repository/org/incode/module/docrendering/
rm -Rf ~/.m2/repository/org/estatio/
mvn clean install -T1C -o || exit 1 >/dev/null
echo ""
echo "bumping version to $SNAPSHOT_VERSION"
echo ""
mvn versions:set -DnewVersion=$SNAPSHOT_VERSION -DgenerateBackupPoms=false || exit 1 > /dev/null
echo "Committing changes"
git commit -am "$JIRA: bumping to next snapshot $SNAPSHOT_VERSION" || exit 1
echo ""
echo "building new snapshot locally"
echo ""
mvn clean install -T1C -o -DskipTests=true || exit 1 >/dev/null