-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
/
Copy pathbuild_docs.sh
executable file
·57 lines (42 loc) · 1.31 KB
/
build_docs.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
#!/bin/bash
set -e
if [ "${TRAVIS_OS_NAME}" != "linux" ]; then
echo "not doing build_docs on non-linux"
exit 0
fi
cd "$TRAVIS_BUILD_DIR"/doc
echo "inside $0"
if [ "$DOC" ]; then
echo "Will build docs"
echo ###############################
echo # Log file for the doc build #
echo ###############################
echo ./make.py
./make.py
echo ########################
echo # Create and send docs #
echo ########################
echo "Only uploading docs when TRAVIS_PULL_REQUEST is 'false'"
echo "TRAVIS_PULL_REQUEST: ${TRAVIS_PULL_REQUEST}"
if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
cd build/html
git config --global user.email "[email protected]"
git config --global user.name "pandas-docs-bot"
# create the repo
git init
touch README
git add README
git commit -m "Initial commit" --allow-empty
git branch gh-pages
git checkout gh-pages
touch .nojekyll
git add --all .
git commit -m "Version" --allow-empty
git remote remove origin
git remote add origin "https://${PANDAS_GH_TOKEN}@github.com/pandas-dev/pandas-docs-travis.git"
git fetch origin
git remote -v
git push origin gh-pages -f
fi
fi
exit 0