Skip to content

Commit 219b310

Browse files
committed
mejora del Dockerfile y de la generación de logs en ejecución
1 parent 1a559eb commit 219b310

26 files changed

+583
-19
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
0*
1+
Dockerfile.ubuntu18.04
2+
Dockerfile.ubuntu20.04

Dockerfile

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
FROM ubuntu:18.04
2-
MAINTAINER Adolfo Sanz De Diego [email protected]
3-
ENV VERSION 0.0.2
1+
FROM node:14.12.0-buster-slim
2+
LABEL MAINTAINER Adolfo Sanz De Diego [email protected]
3+
ENV VERSION 0.0.3
44
# Software dependencies
55
ARG DEBIAN_FRONTEND=noninteractive
6-
RUN apt-get update && \
7-
apt-get -y install wget unzip npm chromium-browser \
8-
texlive-latex-base texlive-fonts-recommended texlive-latex-extra && \
9-
npm install -g decktape
6+
RUN apt-get update
7+
RUN apt-get -y install wget curl unzip chromium
8+
RUN apt-get -y install texlive-latex-base texlive-fonts-recommended texlive-latex-extra
9+
RUN apt-get -y install npm
10+
# ENV PUPPETEER_SKIP_DOWNLOAD='true'
11+
RUN npm config set unsafe-perm true
12+
RUN npm install -g [email protected]
1013
WORKDIR /home/
1114
RUN wget https://github.com/jgm/pandoc/releases/download/2.9.2/pandoc-2.9.2-1-amd64.deb && \
1215
dpkg -i pandoc-2.9.2-1-amd64.deb

build.sh

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ function cleanMdToBook() {
250250

251251
cp "../export/$NAME-import$PLUS.md" "../export/$NAME-book$PLUS.md"
252252

253-
verbose "Cleaning md to book... ../export/$NAME-book$PLUS.md"
253+
debug "Cleaning md to book... ../export/$NAME-book$PLUS.md"
254254

255255
# remove % if img
256256
sed -i 's/% !\[/!\[/g' "../export/$NAME-book$PLUS.md"
@@ -358,9 +358,15 @@ function buildRevealSlidesPdf() {
358358

359359
info "Exporting... ../export/$NAME-slides$PLUS.pdf"
360360

361-
decktape --chrome-arg=--no-sandbox \
362-
--size "$DECKTAPE_RESOLUTION" --pause "$DECKTAPE_PAUSE" reveal \
363-
"file://$(pwd)/../export/$NAME-slides-pdf$PLUS.html" "../export/$NAME-slides$PLUS.pdf" > /dev/null
361+
if [ "$LOG_LEVEL" -ge "$VERBOSE" ]; then
362+
decktape --chrome-arg=--no-sandbox \
363+
--size "$DECKTAPE_RESOLUTION" --pause "$DECKTAPE_PAUSE" reveal \
364+
"file://$(pwd)/../export/$NAME-slides-pdf$PLUS.html" "../export/$NAME-slides$PLUS.pdf"
365+
else
366+
decktape --chrome-arg=--no-sandbox \
367+
--size "$DECKTAPE_RESOLUTION" --pause "$DECKTAPE_PAUSE" reveal \
368+
"file://$(pwd)/../export/$NAME-slides-pdf$PLUS.html" "../export/$NAME-slides$PLUS.pdf" > /dev/null
369+
fi
364370

365371
rm -f "../export/$NAME-slides-pdf$PLUS.html"
366372

@@ -540,7 +546,7 @@ function addImportToMD() {
540546
local BASENAME_FILE_TO_IMPORT
541547
BASENAME_FILE_TO_IMPORT="$(basename "$FILE_TO_IMPORT")"
542548

543-
verbose "Importing file... $FILE_TO_IMPORT"
549+
debug "Importing file... $FILE_TO_IMPORT"
544550

545551
generatePlusAndNormalMD "$FILE_TO_IMPORT" "$BASENAME_FILE_TO_IMPORT"
546552

@@ -589,11 +595,11 @@ function generatePlusAndNormalMD() {
589595
local INPUT="$1"
590596
local OUTPUT="$2"
591597

592-
verbose "Generating file... ../export/$OUTPUT.md"
598+
debug "Generating file... ../export/$OUTPUT.md"
593599
echo -n > "../export/$2.md"
594600

595601
if [ "$GENERATE_PLUS_VERSION" == "yes" ]; then
596-
verbose "Generating file... ../export/$OUTPUT-plus.md"
602+
debug "Generating file... ../export/$OUTPUT-plus.md"
597603
echo -n > "../export/$OUTPUT-plus.md"
598604
fi
599605

@@ -610,7 +616,7 @@ function generatePlusAndNormalMD() {
610616
fi
611617
done < "$INPUT"
612618

613-
verbose "- - - - - - - - - - - - - - - -"
619+
debug "- - - - - - - - - - - - - - - -"
614620
}
615621

616622
function exportMdFile() {
@@ -692,14 +698,24 @@ function processFolder() {
692698
fi
693699
done
694700

695-
cd ../.. > /dev/null
701+
if [ "$LOG_LEVEL" -ge "$VERBOSE" ]; then
702+
cd ../..
703+
else
704+
cd ../.. > /dev/null
705+
fi
696706

697707
if [ "$ZIP_EXPORT_FOLDER" == "yes" ]; then
698708
info "-------------------------------"
699709
info "Ziping export folder... ../export/$FOLDER.zip"
700710
cd "$FOLDER/export"
701-
zip -r "$FOLDER.zip" . > /dev/null
702-
cd ../.. > /dev/null
711+
712+
if [ "$LOG_LEVEL" -ge "$VERBOSE" ]; then
713+
zip -r "$FOLDER.zip" .
714+
cd ../..
715+
else
716+
zip -r "$FOLDER.zip" . > /dev/null
717+
cd ../.. > /dev/null
718+
fi
703719
fi
704720

705721
chmod 755 "$FOLDER/export"

doc/export/leeme-book-plus.docx

-1 Bytes
Binary file not shown.

doc/export/leeme-book-plus.epub

-1 Bytes
Binary file not shown.

doc/export/leeme-book-plus.pdf

-836 Bytes
Binary file not shown.

doc/export/leeme-book.docx

0 Bytes
Binary file not shown.

doc/export/leeme-book.epub

0 Bytes
Binary file not shown.

doc/export/leeme-book.pdf

-358 Bytes
Binary file not shown.

doc/export/leeme-slides-plus.pdf

-160 KB
Binary file not shown.

0 commit comments

Comments
 (0)