-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·89 lines (71 loc) · 2.09 KB
/
build.sh
File metadata and controls
executable file
·89 lines (71 loc) · 2.09 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/bash
read -r -d '' help_text <<- EOM
Usage:
-b - specify custom branch to clone. Default is 'develop'
-n - custom namespace on github to clone from. Default is 'NSAPH-Data-Platform'
EOM
branch="develop"
namespace="NSAPH-Data-Platform"
dot -V
if [ $? -ne 0 ]
then
echo "Graphviz `dot` utility is required to build this documentation. Please install: https://graphviz.org/download/"
exit 1
fi
while getopts b:n: flag
do
case "${flag}" in
b) branch=${OPTARG};;
n) namespace=${OPTARG};;
*) echo "$help_text"; exit;;
esac
done
rm -rf docs
rm -rf doc/common && mkdir doc/common
package_prefix="nsaph-"
packages=("platform-deployment" "utils" "core-platform" "gis" "epa" "gridmet" "cms" "census")
for name in "${packages[@]}"
do
package="${package_prefix}${name}"
git clone --branch $branch https://github.com/$namespace/$package doc/common/$name
# install library with dependencies
if [ -a doc/common/$name/setup.py ]
then
pip install doc/common/$name
fi
# install dependencies if exists
if [ -a doc/common/$name/requirements.txt ]
then
pip install -r doc/common/$name/requirements.txt
fi
# prepare rst templates for Python modules
if [ -d doc/common/$name/src/python ]
then
collector doc/common/$name/src/python doc/common/$name/doc/members
fi
if [ "$name" = "utils" ]
then
collector doc/common/$name doc/common/$name/doc/members
fi
# prepare markdown templates for CWL files
if [ -d doc/common/$name/src/cwl ]
then
mkdir -p doc/common/$name/doc/pipeline
cwl2md -i doc/common/$name/src/cwl -o doc/common/$name/doc/pipeline
fi
# make python sources available for autodoc
abs_path=`realpath doc/common/$name/src/python`
if [ -n "$abs_path" ]
then
export PATH="$abs_path:$PATH"
fi
done
copy_section doc/common/utils/README.md doc/home.md nsaph_utils
copy_section doc/common/core-platform/README.md doc/home.md nsaph
copy_section doc/common/gis/README.md doc/home.md gis
# build documentation
sphinx-build doc docs || exit
touch docs/.nojekyll
# remove copied repos
# rm -rf doc/common
git add docs