forked from apiman/apiman
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·74 lines (59 loc) · 1.67 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
#!/bin/sh
echo ""
echo "######################################"
echo " Releasing APIMan"
echo "######################################"
echo ""
BRANCH=`git rev-parse --abbrev-ref HEAD`
echo "** Current Branch: $BRANCH **"
echo ""
RELEASE_VERSION=$1
DEV_VERSION=$2
GPG_PASSPHRASE=$3
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
if [ "x$GPG_PASSPHRASE" = "x" ]
then
read -p "GPG Passphrase: " GPG_PASSPHRASE
fi
echo "######################################"
echo "Release Version: $RELEASE_VERSION"
echo "Dev Version: $DEV_VERSION"
echo "######################################"
rm -rf ~/.m2/repository/io/apiman
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
mkdir ~/tmp
mkdir ~/tmp/apiman-releases
cp distro/wildfly8/target/*.zip ~/tmp/apiman-releases
cp distro/eap64/target/*.zip ~/tmp/apiman-releases
echo ""
echo ""
echo " ***** USER ACTION REQUIRED *****"
read -p "Do some smoke tests now! Press Enter if everything is OK." CONFIRM
git tag -a -m "Tagging release $RELEASE_VERSION" apiman-$RELEASE_VERSION
git push origin apiman-$RELEASE_VERSION
mvn clean deploy -Dgpg.passphrase=$GPG_PASSPHRASE
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