Skip to content

Commit 4fe1e0c

Browse files
committed
add publish_docs.sh
1 parent f7ee301 commit 4fe1e0c

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

publish_docs.sh

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
installdir='/www/apache/htdocs/software/python/asteval'
2+
docbuild='doc/_build'
3+
proj='asteval'
4+
pdfname='$proj.pdf'
5+
cd doc
6+
echo '# Making docs'
7+
make all
8+
cd ../
9+
10+
echo '# Building tarball of docs'
11+
mkdir _tmpdoc
12+
cp -pr doc/$proj.pdf _tmpdoc/$proj.pdf
13+
cp -pr doc/_build/html/* _tmpdoc/.
14+
cd _tmpdoc
15+
tar czf ../../$proj_docs.tar.gz .
16+
cd ..
17+
rm -rf _tmpdoc
18+
19+
#
20+
echo "# Switching to gh-pages branch"
21+
git checkout gh-pages
22+
23+
if [ $? -ne 0 ] ; then
24+
echo ' failed.'
25+
exit
26+
fi
27+
28+
tar xzf ../$proj_docs.tar.gz .
29+
30+
echo "# commit changes to gh-pages branch"
31+
git add *.html
32+
git commit -am "changed docs"
33+
34+
if [ $? -ne 0 ] ; then
35+
echo ' failed.'
36+
exit
37+
fi
38+
39+
echo "# Pushing docs to github"
40+
git push
41+
42+
echo "# switch back to master branch"
43+
git checkout master
44+
45+
if [ $? -ne 0 ] ; then
46+
echo ' failed.'
47+
exit
48+
fi
49+
50+
# install locally
51+
echo "# Installing docs to CARS web pages"
52+
cp ../$proj_docs.tar.gz $installdir/..
53+
54+
cd $installdir
55+
if [ $? -ne 0 ] ; then
56+
echo ' failed.'
57+
exit
58+
fi
59+
60+
tar xvzf ../$proj_docs.tar.gz

0 commit comments

Comments
 (0)