forked from solidfire/solidfire-sdk-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·31 lines (23 loc) · 1.09 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·31 lines (23 loc) · 1.09 KB
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
#!/bin/bash
# enable error reporting to the console
set -ev
echo $TOXENV
echo $TRAVIS_BRANCH
# only proceed script when started not by pull request (PR)
if [[ "$TRAVIS_BRANCH" == feature* ]] || [[ "$TOXENV" != "py35" ]]; then
echo "this is PR, exiting"
exit 0
fi
#clone "master" branch of the repository using encrypted GH_TOKEN for authentification
git clone -b gh-pages https://${GH_TOKEN}@github.com/solidfire/solidfire-sdk-python.git ../solidfire-sdk-python.gh-pages
# copy generated HTML site to "master" branch
sed 's/::$/:/' README.rst | tail -n+5 > ../solidfire-sdk-python.gh-pages/README.md
cat ../solidfire-sdk-python.gh-pages/front.yml ../solidfire-sdk-python.gh-pages/README.md > ../solidfire-sdk-python.gh-pages/index.md
# commit and push generated content to `master' branch
# since repository was cloned in write mode with token auth - we can push there
cd ../solidfire-sdk-python.gh-pages
git config user.email "[email protected]"
git config user.name "Jason Ryan Womack"
git add -A .
git commit -a -m "Travis #$TRAVIS_BUILD_NUMBER"
git push --quiet origin gh-pages > /dev/null 2>&1