forked from ushahidi/SMSSync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·74 lines (50 loc) · 1.28 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/bash
# Make a release to the SMSSync app.
# TODO:: Look into making this a Gradle task
if [[ $# -lt 2 ]]
then
echo "Usage: release.sh [version number. eg.v2.0.1] [tag message eg. Bug release]"
exit 1
fi
TAG_NAME=$1
TAG_MESSAGE=$2
DEVELOP='develop'
MASTER='master'
TMP_DIR='/tmp/website-src'
echo $TAG_MESSAGE
# SMSSync source code
SMSSYNC='smssync'
# Merge develop branch into master
# Checkout master branch
echo "Checking out the master branch..."
git checkout $MASTER
# Merge develop branch into master branch
echo "Merging develop branch into master"
git merge $DEVELOP
# Create the signed release tag
echo "Creating release tag $TAG_NAME ..."
git tag $TAG_NAME -m $TAG_MESSAGE
# Create a release apk
echo "Building a release apk"
./gradlew clean assemble
# Push tags to remote repo
echo "Pushing tags to remote repo..."
git push origin master --tags
# Compile HTML files
# cd into the website folder
echo "Compiling website"
pushd website-src
bundle exec ruhoh compile $TMP_DIR
cp CNAME $TMP_DIR
popd
pushd $TMP_DIR
git init
git add .
git commit -m "Updating webiste..."
git push [email protected]:ushahidi/SMSSync.git master:gh-pages --force
popd
echo "Website update done"
# Checkout develop branch
echo "Checking out develop branch..."
git checkout $DEVELOP
echo "Done!"