Skip to content

Commit ad91d79

Browse files
committed
Add-in build scripts
1 parent c9021c9 commit ad91d79

10 files changed

+136
-2
lines changed

Diff for: .gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ tcl/
9696
bin/
9797

9898
# bash
99-
*.sh
99+
#*.sh
100100

101101
# misc
102-
containthedocs*
102+
#containthedocs*
103103

104104
# VS Code
105105
.vscode/*

Diff for: containthedocs-bash.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
set -x
4+
5+
COMMAND="/bin/bash"
6+
7+
. ./containthedocs-image
8+
9+
exec docker run --rm -it \
10+
-v "$PWD":"$PWD" --workdir "$PWD" \
11+
${DOCKER_RUN_ARGS} \
12+
-e "LOCAL_USER_ID=$(id -u)" \
13+
${DOC_IMG} ${COMMAND}

Diff for: containthedocs-build.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
set -x
4+
5+
COMMAND="make -C docs html"
6+
7+
. ./containthedocs-image
8+
9+
exec docker run --rm -it \
10+
-v "$PWD":"$PWD" --workdir "$PWD" \
11+
${DOCKER_RUN_ARGS} \
12+
-e "LOCAL_USER_ID=$(id -u)" \
13+
${DOC_IMG} ${COMMAND}

Diff for: containthedocs-clean.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
set -x
4+
5+
COMMAND="make -C docs clean"
6+
7+
. ./containthedocs-image
8+
9+
exec docker run --rm -it \
10+
-v "$PWD":"$PWD" --workdir "$PWD" \
11+
${DOCKER_RUN_ARGS} \
12+
-e "LOCAL_USER_ID=$(id -u)" \
13+
${DOC_IMG} ${COMMAND}

Diff for: containthedocs-cleanbuild.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
set -x
4+
5+
COMMAND="make -C docs clean html"
6+
7+
. ./containthedocs-image
8+
9+
exec docker run --rm -it \
10+
-v "$PWD":"$PWD" --workdir "$PWD" \
11+
${DOCKER_RUN_ARGS} \
12+
-e "LOCAL_USER_ID=$(id -u)" \
13+
${DOC_IMG} ${COMMAND}

Diff for: containthedocs-convert.sh

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
3+
set -x
4+
5+
if [ "$#" -ne 1 ]; then
6+
echo "Usage $0 <file.docx>"
7+
exit 1
8+
fi
9+
10+
COMMAND="scripts/convertdocx.sh $1"
11+
12+
. ./containthedocs-image
13+
14+
exec docker run --rm -it \
15+
-v "$PWD":"$PWD" --workdir "$PWD" \
16+
${DOCKER_RUN_ARGS} \
17+
-e "LOCAL_USER_ID=$(id -u)" \
18+
${DOC_IMG} ${COMMAND}

Diff for: containthedocs-image

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
: ${DOC_IMG:=0xhiteshpatel/containthedocs:2.3}

Diff for: containthedocs-pdf-perclass.sh

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env bash
2+
3+
set -x
4+
5+
. ./containthedocs-image
6+
7+
WD=$PWD
8+
9+
mkdir -p tmp pdf
10+
cd docs
11+
find . -type f ! -path "./class*" | tar -cf ../tmp/base.tar -T -
12+
cd ..
13+
14+
for i in `find . -maxdepth 2 -name class* -type d`
15+
do
16+
CLASS=`basename $i`
17+
cd $WD/tmp
18+
mkdir $WD/tmp/$CLASS
19+
cd $WD/tmp/$CLASS
20+
tar -xf $WD/tmp/base.tar
21+
cp -Rf $WD/docs/$CLASS .
22+
docker run --rm -it \
23+
-v $PWD:$PWD --workdir $PWD \
24+
${DOCKER_RUN_ARGS} \
25+
-e "LOCAL_USER_ID=$(id -u)" \
26+
${DOC_IMG} make latexpdf
27+
28+
PDFPATH=`ls _build/latex/*.pdf`
29+
PDFNAME=${PDFPATH##*/}
30+
NAME=${PDFNAME%.pdf}
31+
cp $PDFPATH $WD/pdf/$NAME-$CLASS.pdf
32+
cd ..
33+
rm -Rf $WD/tmp/$CLASS
34+
done
35+
cd ..
36+
rm -Rf $WD/tmp
37+
38+
echo ""
39+
echo "Done... per-class PDF's are in the ./pdf directory"

Diff for: containthedocs-pdf.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
3+
set -x
4+
5+
. ./containthedocs-image
6+
7+
exec docker run --rm -it \
8+
-v $PWD:$PWD --workdir $PWD \
9+
${DOCKER_RUN_ARGS} \
10+
-e "LOCAL_USER_ID=$(id -u)" \
11+
${DOC_IMG} make -C docs latexpdf

Diff for: containthedocs-spelling.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
set -x
4+
5+
COMMAND="make -C docs spelling"
6+
7+
. ./containthedocs-image
8+
9+
exec docker run --rm -it \
10+
-v "$PWD":"$PWD" --workdir "$PWD" \
11+
${DOCKER_RUN_ARGS} \
12+
-e "LOCAL_USER_ID=$(id -u)" \
13+
${DOC_IMG} ${COMMAND}

0 commit comments

Comments
 (0)