Skip to content

Commit df033ca

Browse files
committed
DOC: pull files via Git LFS on readthedocs hosts
The indicator environment variable is listed at https://docs.readthedocs.io/en/stable/builds.html This solution follows the current best practice presented at readthedocs/readthedocs.org#1846 [ci skip]
1 parent d38367c commit df033ca

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

doc/conf.py

+7
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,10 @@
2121
html_theme = 'alabaster'
2222
html_static_path = ['_static']
2323
htmlhelp_basename = 'hardsharedoc'
24+
25+
26+
# Prepare to build on hosts of https://readthedocs.org/
27+
import os
28+
if os.environ.get('READTHEDOCS', 'False') == 'True':
29+
import subprocess
30+
subprocess.check_call('./get-deps.sh')

doc/get-deps.sh

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/sh -e
2+
# Script to fetch and prepare dependencies to build documentation
3+
#
4+
#
5+
6+
# Copyright (C) 2020 rerobots, Inc.
7+
8+
9+
GLFSVERSION=2.11.0
10+
FNAME=git-lfs-linux-amd64-v${GLFSVERSION}.tar.gz
11+
12+
13+
if [ ! -f $FNAME ]; then
14+
curl -L -O https://github.com/git-lfs/git-lfs/releases/download/v${GLFSVERSION}/${FNAME}
15+
fi
16+
17+
HASHNOW=`sha512sum $FNAME | cut -d ' ' -f1`
18+
if [ "$HASHNOW" != "ed84947ddf492ef7a9480cb826e2667240743cc10a07e186a5759b0b2961decc176cfb7ede2e21b7e764b200dd0b431297be30597553282ef4da5ce10c2fc4d7" ]; then
19+
echo "Error: wrong checksum: $HASHNOW"
20+
exit 1
21+
fi
22+
23+
tar -xzf $FNAME
24+
./git-lfs install
25+
./git-lfs fetch
26+
./git-lfs checkout

0 commit comments

Comments
 (0)