forked from apiman/apiman-quickstarts
-
Notifications
You must be signed in to change notification settings - Fork 2
/
release.sh
executable file
·58 lines (45 loc) · 1.26 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
#!/bin/sh
echo ""
echo "######################################"
echo " Releasing apiman quickstarts"
echo "######################################"
echo ""
BRANCH=`git rev-parse --abbrev-ref HEAD`
echo "** Current Branch: $BRANCH **"
echo ""
RELEASE_VERSION=$1
DEV_VERSION=$2
if [ "x$RELEASE_VERSION" = "x" ]
then
read -p "Release Version: " RELEASE_VERSION
fi
if [ "x$DEV_VERSION" = "x" ]
then
read -p "New Development Version: " DEV_VERSION
fi
echo "######################################"
echo "Release Version: $RELEASE_VERSION"
echo "Dev Version: $DEV_VERSION"
echo "######################################"
mvn clean install
STATUS=$?
if [ $STATUS -eq 0 ]; then
echo "Build success!"
else
echo "Build failed!"
exit 1
fi
mvn versions:set -DnewVersion=$RELEASE_VERSION
find . -name '*.versionsBackup' -exec rm -f {} \;
git add .
git commit -m "Prepare for release $RELEASE_VERSION"
git push origin $BRANCH
mvn clean install
git tag -a -m "Tagging release $RELEASE_VERSION" apiman-quickstarts-$RELEASE_VERSION
git push origin apiman-quickstarts-$RELEASE_VERSION
mvn deploy
mvn versions:set -DnewVersion=$DEV_VERSION
find . -name '*.versionsBackup' -exec rm -f {} \;
git add .
git commit -m "Update to next development version: $DEV_VERSION"
git push origin $BRANCH