-
Notifications
You must be signed in to change notification settings - Fork 2
/
publish_docs.sh
69 lines (51 loc) · 1.09 KB
/
publish_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
58
59
60
61
62
63
64
65
66
67
installdir='/www/apache/htdocs/software/python/pyepics3'
docbuild='doc/_build'
cd doc
echo '# Making docs'
make all
cd ../
echo '# Building tarball of docs'
mkdir _tmpdoc
cp -pr doc/pyepics.pdf _tmpdoc/pyepics.pdf
cp -pr doc/_build/html/* _tmpdoc/.
cd _tmpdoc
tar czf ../../pyepics_docs.tar.gz .
cd ..
rm -rf _tmpdoc
#
echo "# Switching to gh-pages branch"
git checkout gh-pages
if [ $? -ne 0 ] ; then
echo ' failed.'
exit
fi
echo "# Make sure this script is updated!"
git checkout master publish_docs.sh
if [ $? -ne 0 ] ; then
echo ' failed.'
exit
fi
tar xzf ../pyepics_docs.tar.gz .
echo "# commit changes to gh-pages branch"
git commit -am "changed docs"
if [ $? -ne 0 ] ; then
echo ' failed.'
exit
fi
echo "# Pushing docs to github"
git push
echo "# switch back to master branch"
git checkout master
if [ $? -ne 0 ] ; then
echo ' failed.'
exit
fi
# install locally
echo "# Installing docs to CARS web pages"
cp ../pyepics_docs.tar.gz $installdir/../.
cd $installdir
if [ $? -ne 0 ] ; then
echo ' failed.'
exit
fi
tar xzf ../pyepics_docs.tar.gz .