forked from RomanSavran/standards-1
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sh
executable file
·30 lines (23 loc) · 971 Bytes
/
build.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
#!/bin/sh
set -eo pipefail
readonly STANDARD_VERSION="v1"
readonly CNAME_ADDRESS="standards.lifeengine.io"
readonly WORKDIR="/src/${STANDARD_VERSION}"
readonly ONT_FILE="${WORKDIR}/Ontology/dli.jsonld"
readonly OUT_FOLDER="/tmp/html"
readonly ARTIFACTS_ROOT="/artifacts"
readonly ARTIFACTS="${ARTIFACTS_ROOT}/${STANDARD_VERSION}"
readonly THEME="darkly"
cd "${WORKDIR}"
python ../githubify.py "${STANDARD_VERSION}"
mkdir "${OUT_FOLDER}"
mkdir "${ARTIFACTS}"
ontospy gendocs "${ONT_FILE}" -o "${OUT_FOLDER}" --title "Digital Living" --theme="${THEME}" --type 2
# Copy the HTML to the artifacts folder.
cp -R "${OUT_FOLDER}"/* "${ARTIFACTS}"/
# Copy over the ontologies and contexts to GH pages
cp -R "${WORKDIR}/Context" "${ARTIFACTS}"/
cp -R "${WORKDIR}/Vocabulary" "${ARTIFACTS}"/
cp -R "${WORKDIR}/ClassDefinitions" "${ARTIFACTS}"/
echo "${CNAME_ADDRESS}" > "${ARTIFACTS_ROOT}"/CNAME
echo -e "plugins:\n - jekyll-redirect-from" > "${ARTIFACTS_ROOT}"/_config.yml