-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·39 lines (31 loc) · 1.11 KB
/
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
31
32
33
34
35
36
37
38
39
#!/bin/sh
set -eu;
output="${1-./build}";
echo "Building to: '${output}'";
mkdir -p "${output}";
# Workaround for running as root
# https://github.com/mermaid-js/mermaid-cli/blob/master/docs/linux-sandbox-issue.md
PUPPETEER_CONFIG="";
if [ "$(id -u)" -eq 0 ] && [ -n "${CI}" ]; then
PUPPETEER_CONFIG="puppeteer-config.json";
echo '{ "args": ["--no-sandbox"] }' > "${PUPPETEER_CONFIG}";
PUPPETEER_CONFIG=$(realpath "${PUPPETEER_CONFIG}");
fi
# Build presentations
asciidoctor-revealjs -vw -r asciidoctor-diagram \
${PUPPETEER_CONFIG:+-a "mermaid-puppeteer-config=${PUPPETEER_CONFIG}"} \
"presentations/Synthesizer.adoc" \
-o "${output}/presentations/Synthesizer.html";
asciidoctor-revealjs -vw -r asciidoctor-diagram \
${PUPPETEER_CONFIG:+-a "mermaid-puppeteer-config=${PUPPETEER_CONFIG}"} \
"presentations/GUI.adoc" \
-o "${output}/presentations/GUI.html";
cp -r \
"presentations/images" \
"presentations/style.css" \
"papers_synthesizer" \
"${output}/presentations";
asciidoctor -vw "README.adoc" -o "${output}/index.html";
cp -r "papers_synthesizer" \
"${output}/papers_synthesizer";
echo "Build complete";