Nettoyage

This commit is contained in:
Benjamin Bohard 2022-08-11 09:00:15 +02:00
parent 2ba42c7f37
commit 2e97a67522
16 changed files with 97 additions and 15 deletions

View File

@ -0,0 +1,4 @@
#!/bin/ash
cd /src
./build

View File

@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -e
echo 'RUN apk update && apk upgrade' >> Dockerfile
echo 'RUN apk add --no-cache git' >> Dockerfile

View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -e
echo 'RUN apk add --no-cache py3-setuptools py3-pygments font-liberation texlive-full' >> Dockerfile

View File

@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -e
echo 'ENV NODE_VERSION 16.16.0' >> Dockerfile
echo 'ENV YARN_VERSION 1.22.19' >> Dockerfile
echo 'ENV ARCH x64' >> Dockerfile
echo 'ENV CHECKSUM 2b74f0baaaa931ffc46573874a7d7435b642d28f1f283104ac297499fba99f0a' >> Dockerfile
echo 'RUN addgroup -g 1000 node && adduser -u 1000 -G node -s /bin/sh -D node && apk add --no-cache libstdc++ && apk add --no-cache --virtual .build-deps curl' >> Dockerfile
echo 'RUN curl -fsSLO --compressed "https://unofficial-builds.nodejs.org/download/release/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz"; echo "$CHECKSUM node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" | sha256sum -c - && tar -xJf "node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" -C /usr/local --strip-components=1 --no-same-owner && ln -s /usr/local/bin/node /usr/local/bin/nodejs && rm -f "node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" && apk del .build-deps && node --version && npm --version' >> Dockerfile
echo 'RUN apk add --no-cache --virtual .build-deps-yarn curl gnupg tar && for key in 6A010C5166006599AA17F08146C2130DFD2497F5 ; do gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" || gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" ; done && curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" && curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" && gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz && mkdir -p /opt && tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ && ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn && ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg && rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz && apk del .build-deps-yarn && yarn --version' >> Dockerfile
echo 'RUN apk update && apk upgrade' >> Dockerfile
echo 'RUN apk add --no-cache grep chromium freetype libstdc++ harfbuzz ttf-liberation font-noto-cjk font-noto-devanagari font-noto-arabic font-noto-bengali nss wayland-dev su-exec' >> Dockerfile
echo 'RUN addgroup -S marp && adduser -S -g marp marp && mkdir -p /home/marp/app /home/marp/.cli && chown -R marp:marp /home/marp' >> Dockerfile
echo 'USER marp' >> Dockerfile
echo 'ENV CHROME_PATH /usr/bin/chromium-browser' >> Dockerfile
echo 'RUN git clone https://github.com/marp-team/marp-cli.git /home/marp/.cli' >> Dockerfile
echo 'WORKDIR /home/marp/.cli' >> Dockerfile
echo 'RUN git checkout v2.0.4' >> Dockerfile
echo 'RUN ls .' >> Dockerfile
echo 'RUN yarn add @babel/core' >> Dockerfile
echo 'RUN yarn install --production --frozen-lockfile && yarn cache clean && node marp-cli.js --version' >> Dockerfile

View File

@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -e
echo 'RUN apk add --no-cache python3 bash' >> Dockerfile
echo 'ENTRYPOINT [""]' >> Dockerfile
echo 'RUN npm install -g --save-prod markdown-it markdown-it-mark markdown-it-include markdown-it-anchor markdown-it-table-of-contents' >> Dockerfile
echo 'ENV NODE_PATH=/usr/local/lib/node_modules' >> Dockerfile
echo 'RUN mkdir /dist && mkdir /dist/private && mkdir /dist/public' >> Dockerfile

View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -e
if [ -e './datasets/fonts' ]
then
for font_file in $(find . -wholename "./datasets/fonts/*.ttf")
do
echo 'COPY datasets/fonts/$font_file /root/.fonts/$font_file' >> Dockerfile
done
fi
exit 0

3
hooks/postbuild/common/done Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
tamarin_success "Done :-)"

View File

@ -5,8 +5,9 @@ mkdir -p /dist
# Move generated files
pushd /src
mv ./output_public /dist/public
mv ./output_private /dist/private
ls -l ./output_public
cp ./output_public/*.pdf /dist/public
cp ./output_private/*.pdf /dist/private
popd
tamarin_success "Done :-)"

View File

@ -1,4 +0,0 @@
#!/usr/bin/env bash
cd src

View File

@ -1,3 +0,0 @@
#!/usr/bin/env bash
cd src

View File

@ -41,7 +41,7 @@ def build_image(build_workspace, base_image, profile_name, profile, debug=False,
# Run hooks
tamarin.run_profile_hooks(profile, 'containerbuild', cwd=build_workspace, env=hooks_env, debug=debug)
image_tag = "tamarin:{:s}_{:s}_{:d}".format(profile_name, base_image.replace(':', '_'), os.getpid())
image_tag = "tamarin:{:s}_{:s}_{:d}".format(profile_name, base_image.replace(':', '_').replace('/', '_'), os.getpid())
build_args = [ "build", "-t", image_tag ]

View File

@ -6,8 +6,8 @@ default_image=ubuntu:jammy
# Configuration de létape de pré-construction du conteneur
[containerbuild]
hooks=
containerbuild/doc-compiler/add-packages,
containerbuild/doc-compiler/add-resources,
containerbuild/latex-compiler/add-packages,
containerbuild/latex-compiler/add-resources,
# Configuration de létape de pré-compilation des documents
[prebuild]
@ -15,15 +15,13 @@ hooks=
prebuild/debian/copy-sources-to-workspace,
prebuild/debian/run-project-hooks,
prebuild/debian/load-project-db,
prebuild/doc-compiler/complete-project-db,
# Configuration de létape de compilation du document
[build]
hooks=build/doc-compiler/compile
hooks=build/latex-compiler/compile
# Configuration de létape de post-compilation du document
[postbuild]
hooks=
postbuild/debian/run-project-hooks,
postbuild/doc-compiler/export-dist,

View File

@ -0,0 +1,27 @@
# Configuration générale du profil
[profile]
# Image Docker par défaut
default_image=marpteam/marp-cli:latest
# Configuration de létape de pré-construction du conteneur
[containerbuild]
hooks=
containerbuild/marp-compiler/add-packages,
containerbuild/marp-compiler/add-resources,
# Configuration de létape de pré-compilation des documents
[prebuild]
hooks=
prebuild/debian/copy-sources-to-workspace,
prebuild/debian/run-project-hooks,
prebuild/debian/load-project-db,
# Configuration de létape de compilation du document
[build]
hooks=build/latex-compiler/compile
# Configuration de létape de post-compilation du document
[postbuild]
hooks=
postbuild/debian/run-project-hooks,
postbuild/common/done