forked from Glucosio/glucosio-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
upload-gh-pages.sh
34 lines (26 loc) · 1.04 KB
/
upload-gh-pages.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
#!/usr/bin/env bash
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
echo -e "Starting to update gh-pages\n"
#copy data we're interested in to other place
mkdir $HOME/android/
mkdir $HOME/android/wear
cp -R app/build/outputs/apk/app-debug.apk $HOME/android/
cp -R wear/build/outputs/apk/wear-debug.apk $HOME/android/wear
#go to home and setup git
cd $HOME
git config --global user.email "[email protected]"
git config --global user.name "Glucat"
#clone gh-pages branch
git clone --quiet --branch=master https://glucat:[email protected]/Glucosio/glucosio.github.io.git master > /dev/null
#go into directory and copy data we're interested
cd master
cp -Rf $HOME/android/* .
#add, commit and push files
git add -f .
git remote rm origin
git remote add origin https://glucat:[email protected]/Glucosio/glucosio.github.io.git
git add -f .
git commit -m "Travis build $TRAVIS_BUILD_NUMBER pushed to gh-pages"
git push -fq origin master > /dev/null
echo -e "Done magic with coverage\n"
fi