-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
executable file
·62 lines (46 loc) · 1.18 KB
/
entrypoint.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
#! /bin/sh
# If not otherwise set, build html
if [ -z ${INPUT_TARGETS+x} ]; then
INPUT_TARGETS="html";
fi
repository=${GITHUB_REPOSITORY}
ref=${GITHUB_REF}
tag=`basename ${ref}`
event_name=${GITHUB_EVENT_NAME}
html_tar_filename=${repository}/docs/_build/docs_html.tar.gz
pdf_tar_filename=${repository}/docs/_build/docs_pdf.tar.gz
echo GitHub repository: ${repository}
echo GitHub ref: ${ref}
echo GitHub event_name: ${event_name}
echo #########
echo current_dir: `pwd`
echo #########
echo ls: `ls`
echo #########
echo environment: `printenv`
printenv
echo #########
# Sub-routine for running a command and checking return status
function run_command() {
# Print the command being called
echo "CALLING: $1"
# Run the command and store the return status
$1
STATUS=$?
# Check return status
if [[ ${STATUS} -ne 0 ]]; then
echo "ERROR: Command returned with non-zero status ($STATUS): $1"
exit ${STATUS}
fi
return ${STATUS}
}
###
# install requirements, as needed
###
run_command "python -m pip install --exists-action=w --no-cache-dir -r docs/requirements.txt"
###
# build the docs
###
run_command "cd docs"
run_command "make clean ${INPUT_TARGETS}"
exit 0