-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.sh
executable file
·51 lines (34 loc) · 1001 Bytes
/
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
#!/bin/sh
VERSION_FILE="version.info"
source $VERSION_FILE
echo "Current version: $VERSION"
MAJOR_MINOR=${VERSION%-*}
MAJOR=${MAJOR_MINOR%.*}
MINOR=${MAJOR_MINOR#*.}
IS_SNAPSHOT=${VERSION#*-}
if [ "$IS_SNAPSHOT" != "SNAPSHOT" ] ; then
echo "Current version is release already."
exit 1
fi
RELEASE_VERSION=$MAJOR_MINOR
echo "Current release version: $RELEASE_VERSION"
FUTURE_VERSION="$MAJOR.$((MINOR+1))"
FUTURE_VERSION_SNAPSHOT="$FUTURE_VERSION-SNAPSHOT"
echo "Future snapshot version: $FUTURE_VERSION_SNAPSHOT"
echo "Releasing..."
# Set release version
echo VERSION='"'$RELEASE_VERSION'"' > $VERSION_FILE
# git commit
git add $VERSION_FILE
git commit -m "release $RELEASE_VERSION"
# git tag
git tag $RELEASE_VERSION
# make a build
./build.sh
# make a deploy
# copy built file (target/uw-VERSION.sh) to nexus
# Set snapshot version
echo VERSION='"'$FUTURE_VERSION_SNAPSHOT'"' > $VERSION_FILE
# git commit
git add $VERSION_FILE
git commit -m "snapshot $FUTURE_VERSION_SNAPSHOT"