-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathrelease.sh
83 lines (67 loc) · 1.47 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
83
RELEASE_VERSION=$1
shift
SNAPSHOT_VERSION=$1
shift
KEYID=$1
shift
PASSPHRASE=$*
if [ ! "$RELEASE_VERSION" -o ! "$SNAPSHOT_VERSION" -o ! "$KEYID" -o ! "$PASSPHRASE" ]; then
echo "usage: $(basename $0) [release_version] [snapshot_version] [keyid] [passphrase]" >&2
exit 1
fi
echo ""
echo "checking no reference to isis.version of -SNAPSHOT"
echo ""
grep SNAPSHOT dom/pom.xml | grep isis.version
if [ $? == 0 ]; then
echo ""
echo "... failed" >&2
exit 1
fi
echo ""
echo "sanity check (mvn clean install -T1C -o)"
echo ""
mvn clean install -T1C -o >/dev/null
if [ $? != 0 ]; then
echo "... failed" >&2
exit 1
fi
echo ""
echo "bumping version to $RELEASE_VERSION"
echo ""
sh ./bumpver.sh $RELEASE_VERSION
if [ $? != 0 ]; then
echo "... failed" >&2
exit 1
fi
echo ""
echo "double-check (mvn clean install -T1C -o)"
echo ""
mvn clean install -T1C -o >/dev/null
if [ $? != 0 ]; then
echo "... failed" >&2
exit 1
fi
echo ""
echo "releasing 'dom' module (mvn clean deploy -P release)"
echo ""
pushd dom >/dev/null
mvn clean deploy -P release -Dpgp.secretkey=keyring:id=$KEYID -Dpgp.passphrase="literal:$PASSPHRASE"
if [ $? != 0 ]; then
echo "... failed" >&2
exit 1
fi
popd >/dev/null
echo ""
echo "bumping version to $SNAPSHOT_VERSION"
echo ""
sh ./bumpver.sh $SNAPSHOT_VERSION
if [ $? != 0 ]; then
echo "... failed" >&2
exit 1
fi
echo ""
echo "now run:"
echo ""
echo "git push origin master && git push origin $RELEASE_VERSION"
echo ""