-
Notifications
You must be signed in to change notification settings - Fork 148
/
release.sh
executable file
·69 lines (51 loc) · 1.41 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
#!/bin/bash
# Make a release to the Ushahidi Android app
if [[ $# -lt 2 ]]
then
echo "Usage: release.sh [version number. eg.v2.0.1] [tag message eg. Bug release]"
exit 1
fi
TAG_NAME=$2
TAG_MESSAGE=$1
DEVELOP='develop'
MASTER='master'
RELEASE='release'
# Ushahidi whitelabled app
USHAHIDI_APP='Themes/Ushahidi/'
# Merge release to master and develop
# Checkout develop branch
echo "Checking out the develop branch..."
git checkout $DEVELOP
# Merge release branch into the develop branch
echo "Merging release branch into develop..."
git merge $RELEASE
# Checkout master branch
echo "Checking out the master branch..."
git checkout $MASTER
# Merge release branch into master branch
echo "Merging release branch into"
git merge $RELEASE
# Delete the release branch
echo "Deleting local release branch..."
git branch -d $RELEASE
# Delete remote release branch
echo "Deleting remote release branch..."
git push origin --delete $RELEASE
# Create the release tag
echo "Creating release tag $TAG_NAME ..."
git tag -a $TAG_NAME -m $TAG_MESSAGE
# Push newly created tag to remote host
echo "Pushing new tag to remote host..."
git push --tags
# Create the release build
echo "Changing directory into $USHAHIDI_APP"
pushd $USHAHIDI_APP
# Create a release apk
echo "Building a release apk"
ant release
# Back to where we were before
popd
# Checkout develop branch
echo "Checking out develop branch..."
git checkout $DEVELOP
echo "Done!"