forked from griffon/griffon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update-gh-pages.sh
executable file
·40 lines (34 loc) · 1.49 KB
/
update-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
35
36
37
38
39
40
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
echo -e "Starting gh-pages update\n"
#copy data were interested in to other place
for projectDir in subprojects samples
do
for project in `ls $TRAVIS_BUILD_DIR/$projectDir`
do
rm -rf $HOME/travis-ci/reports/$project
mkdir -p $HOME/travis-ci/reports/$project
if [ -d "$TRAVIS_BUILD_DIR/$projectDir/$project/build/reports/" ]; then
echo -e "Copying $TRAVIS_BUILD_DIR/$projectDir/$project/build/reports"
cp -R "$TRAVIS_BUILD_DIR/$projectDir/$project/build/reports/" "$HOME/travis-ci/reports/$project"
fi
if [ -d "$TRAVIS_BUILD_DIR/$projectDir/$project/build/test-results/" ]; then
echo -e "Copying $TRAVIS_BUILD_DIR/$projectDir/$project/build/test-results"
cp -R "$TRAVIS_BUILD_DIR/$projectDir/$project/build/test-results/" "$HOME/travis-ci/reports/$project"
fi
done
done
#go to home and setup git
cd $HOME
git config --global user.email "[email protected]"
git config --global user.name "Travis"
#using token clone gh-pages branch
git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/griffon/griffon.git gh-pages > /dev/null
#go into directory and copy data we're interested in to that directory
cd gh-pages/travis-ci
cp -Rf $HOME/travis-ci/* .
#add, commit and push files
git add -f .
git commit -m "Travis build $TRAVIS_BUILD_NUMBER pushed to gh-pages"
git push -fq origin gh-pages > /dev/null
echo -e "Done saving test reports\n"
fi