File: build_deploy_docs_manually.bash

package info (click to toggle)
cclib-data 1.6.2-2
  • links: PTS, VCS
  • area: non-free
  • in suites: bookworm, bullseye, sid
  • size: 87,912 kB
  • sloc: python: 16,440; sh: 131; makefile: 79; cpp: 31
file content (49 lines) | stat: -rw-r--r-- 1,220 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/env bash

# Run this to build the HTML documentation using Sphinx, then commit
# and push it to the docs repo.

set -o errexit

DOCS_REPO_OWNER=cclib
DOCS_REPO_NAME=cclib.github.io
DOCS_BRANCH_NAME=gh-pages
GH_REPO_REF=github.com:$DOCS_REPO_OWNER/$DOCS_REPO_NAME.git

SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

pushd "${SCRIPTDIR}"/../doc

# Make sure a copy of the custom theme is present and up-to-date.
mkdir -p sphinx/_themes
if [ ! -d sphinx/_themes/sphinx_rtd_theme ]; then
    pushd sphinx/_themes/
    git clone -b cclib https://github.com/cclib/sphinx_rtd_theme.git
else
    pushd sphinx/_themes/sphinx_rtd_theme
    git pull
fi
popd

# Build the HTML documentation.
make

if [ ! -d $DOCS_REPO_NAME ]; then
    echo "Cloning $DOCS_BRANCH_NAME branch of $GH_REPO_REF..."
    git clone -b $DOCS_BRANCH_NAME git@$GH_REPO_REF
fi
cd $DOCS_REPO_NAME
rm -rf ./* ./.*
echo "" > .nojekyll
echo "Copying built HTML..."
cp -a ../sphinx/_build/html/* .

echo "Adding changes..."
git add --all
echo "Committing..."
# This will return 1 if there are no changes, which should not result
# in failure.
git commit -m "Deploy documentation `date`" || ret=$?
git push origin $DOCS_BRANCH_NAME

popd