-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocs.sh
executable file
·39 lines (33 loc) · 926 Bytes
/
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
#!/bin/bash
cd ./docs
sphinx-apidoc -f -o source/ ../ImageQ
make html
cd ..
git commit -am "make html"
git config --global push.default simple
git config --global user.email "[email protected]"
git config --global user.name "Travis CI"
# Checkout to gh-pages
git checkout gh-pages
if [ $? -eq 0]; then
echo "Checked out to existing gh-pages branch"
else
git checkout -b gh-pages
echo "Creating gh-pages branch"
fi
#remove existing files except html
shopt -s extglob
rm -r ./!(docs)/
#copy contents of html to root
cp -R ${TRAVIS_BUILD_DIR}/docs/build/html/. ${TRAVIS_BUILD_DIR}/
#remove html and accompanying docs
rm -r ./docs
git add .
git commit -am "rebuilt docs"
git push -q https://${GITHUB_TOKEN}@github.com/bisoncorps/imageQ.git gh-pages --force
# echo if docs was succesfully pushed
if [ $? -eq 0 ]; then
echo "Docs successfully pushed to Github Pages"
else
echo "Failed to push docs"
fi