forked from neo-project/specification
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker_run.sh
executable file
·34 lines (31 loc) · 1.08 KB
/
docker_run.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
#!/bin/bash
function usage {
echo "Usage: $0 [--section <SECTION_NAME>]"
}
SECTION_NAME="nosection"
DISABLE_SECTION=1
while [[ "$#" > 0 ]]; do case $1 in
-h)
usage
exit 0
;;
--section)
# Custom neo-cli zip filename
SECTION_NAME=$2
DISABLE_SECTION=0
shift; shift;
;;
*)
usage
exit 1
;;
esac;
done
mkdir $(pwd)/build
if (($DISABLE_SECTION)); then
echo "BUILDING all chapters. Complete Specification Paper.pdf";
docker run --rm --mount src="$(pwd)/sections",target=/sections,type=bind --mount src="$(pwd)/doc-base",target=/doc-base,type=bind --mount src="$(pwd)/.git",target=/.git,type=bind --mount src="$(pwd)/build",target=/build,type=bind -it pandoc-tex make
else
echo "BUILDING specific chapter $SECTION_NAME";
docker run --rm --mount src="$(pwd)/sections",target=/sections,type=bind --mount src="$(pwd)/doc-base",target=/doc-base,type=bind --mount src="$(pwd)/.git",target=/.git,type=bind --mount src="$(pwd)/build",target=/build,type=bind -it pandoc-tex make section SECTION=$SECTION_NAME
fi