Commit 5f0a9d05 authored by Andreas Böttger's avatar Andreas Böttger 😬
Browse files

Update .gitlab-ci.yml

parent 8aa76ab9
Pipeline #33372 passed with stages
in 1 minute and 20 seconds
...@@ -108,71 +108,81 @@ build_pages: ...@@ -108,71 +108,81 @@ build_pages:
- ./templates/studyreader - ./templates/studyreader
script: script:
- | - |
# Language Verzeichnisse ermitteln und in den Pfad der Abbildungen integrieren (
set -x # Language Verzeichnisse ermitteln und in den Pfad der Abbildungen integrieren
grep -rlP '\.\.\/abb\/' ./_raw/study-book || true) | while read -r line; do set -x
# NUR vier Sprachen werden berücksichtigt: de, en, fa, ar (grep -rlP '\.\.\/abb\/' ./_raw/study-book || true) | while read -r line; do
if [ -n "$line" ]; then # NUR vier Sprachen werden berücksichtigt: de, en, fa, ar
lang="$(echo "$line" | perl -pe 's!.*\/(de|en|fa|ar)\/.*!\1!g')"; if [ -n "$line" ]; then
export lang lang="$(echo "$line" | perl -pe 's!.*\/(de|en|fa|ar)\/.*!\1!g')"
echo "Processing $line" export lang
perl -i -pe 's!(\().*?(abb)!$1/static/studyreader/$ENV{"lang"}/$2!gm' "$line" echo "Processing $line"
fi perl -i -pe 's!(\().*?(abb)!$1/static/studyreader/$ENV{"lang"}/$2!gm' "$line"
done fi
done
)
- | - |
( (
set -x set -x
cd ./_raw/study-book; cd ./_raw/study-book
if [ -f book.json ]; then if [ -f book.json ]; then
jq -r --arg base_path "/${CI_PROJECT_PATH}/~${CI_COMMIT_REF_NAME}/" '.base_path |= $base_path' book.json | sponge book.json; jq -r --arg base_path "/${CI_PROJECT_PATH}/~${CI_COMMIT_REF_NAME}/" '.base_path |= $base_path' book.json | sponge book.json
fi; fi;
if [ -f book.json ]; then if [ -f book.json ]; then
jq -r --arg pluginsConfig__downloadpdf_base "/${CI_PROJECT_PATH}/~${CI_COMMIT_REF_NAME}/book_pdf/book.pdf?/" '.pluginsConfig.downloadpdf.base |= $pluginsConfig__downloadpdf_base' book.json | sponge book.json; jq -r --arg pluginsConfig__downloadpdf_base "/${CI_PROJECT_PATH}/~${CI_COMMIT_REF_NAME}/book_pdf/book.pdf?/" '.pluginsConfig.downloadpdf.base |= $pluginsConfig__downloadpdf_base' book.json | sponge book.json
fi; fi
if [ -f book.json ]; then cat book.json; fi; if [ -f book.json ]; then cat book.json; fi
gitbook install; gitbook install
gitbook build; gitbook build
( (
# `gitbook build` bastelt aus einem absoluten Pfad einen relativen set -x
grep -rlP '\.\.\/static\/' . || true) | while read -r line; do (grep -rlP '\.\.\/static\/' . || true) | while read -r line; do
# NUR vier Sprachen werden berücksichtigt: de, en, fa, ar
if [ -n "$line" ]; then if [ -n "$line" ]; then
# lang="$(echo "$line" | perl -pe 's!.*\/(de|en|fa|ar)\/.*!\1!g')";
# export lang
echo "Processing $line" echo "Processing $line"
perl -i -pe 's!\.\.(/static)!$1!gm' "$line" perl -i -pe 's!\.\.(/static)!$1!gm' "$line"
fi fi
done done
) )
) )
- rm -rf ./templates/studyreader - rm -rf ./templates/studyreader
- mv ./_raw/study-book/_book ./templates/studyreader - mv ./_raw/study-book/_book ./templates/studyreader
- | - |
# Language Verzeichnisse ermitteln und in den Pfad der Abbildungen integrieren (
set -x # Language Verzeichnisse ermitteln und in den Pfad der Abbildungen integrieren
grep -rlP '\.\.\/abb\/' ./_raw/book || true) | while read -r line; do set -x
# NUR vier Sprachen werden berücksichtigt: de, en, fa, ar (grep -rlP '\.\.\/abb\/' ./_raw/book || true) | while read -r line; do
if [ -n "$line" ]; then # NUR vier Sprachen werden berücksichtigt: de, en, fa, ar
lang="$(echo "$line" | perl -pe 's!.*\/(de|en|fa|ar)\/.*!\1!g')"; if [ -n "$line" ]; then
export lang lang="$(echo "$line" | perl -pe 's!.*\/(de|en|fa|ar)\/.*!\1!g')"
echo "Processing $line" export lang
perl -i -pe 's!(\().*?(abb)!$1/static/reader/$ENV{"lang"}/$2!gm' "$line" echo "Processing $line"
fi perl -i -pe 's!(\().*?(abb)!$1/static/reader/$ENV{"lang"}/$2!gm' "$line"
done fi
done
)
- | - |
( (
set -x set -x
cd ./_raw/book; cd ./_raw/book;
if [ -f book.json ]; then if [ -f book.json ]; then
jq -r --arg base_path "/${CI_PROJECT_PATH}/~${CI_COMMIT_REF_NAME}/" '.base_path |= $base_path' book.json | sponge book.json; jq -r --arg base_path "/${CI_PROJECT_PATH}/~${CI_COMMIT_REF_NAME}/" '.base_path |= $base_path' book.json | sponge book.json
fi; fi;
if [ -f book.json ]; then if [ -f book.json ]; then
jq -r --arg pluginsConfig__downloadpdf_base "/${CI_PROJECT_PATH}/~${CI_COMMIT_REF_NAME}/book_pdf/book.pdf?/" '.pluginsConfig.downloadpdf.base |= $pluginsConfig__downloadpdf_base' book.json | sponge book.json; jq -r --arg pluginsConfig__downloadpdf_base "/${CI_PROJECT_PATH}/~${CI_COMMIT_REF_NAME}/book_pdf/book.pdf?/" '.pluginsConfig.downloadpdf.base |= $pluginsConfig__downloadpdf_base' book.json | sponge book.json
fi; fi;
if [ -f book.json ]; then cat book.json; fi; if [ -f book.json ]; then cat book.json; fi
gitbook install; gitbook install
gitbook build gitbook build
( (
# `gitbook build` bastelt aus einem absoluten Pfad einen relativen set -x
grep -rlP '\.\.\/static\/' . || true) | while read -r line; do (grep -rlP '\.\.\/static\/' . || true) | while read -r line; do
# NUR vier Sprachen werden berücksichtigt: de, en, fa, ar
if [ -n "$line" ]; then if [ -n "$line" ]; then
# lang="$(echo "$line" | perl -pe 's!.*\/(de|en|fa|ar)\/.*!\1!g')";
# export lang
echo "Processing $line" echo "Processing $line"
perl -i -pe 's!\.\.(/static)!$1!gm' "$line" perl -i -pe 's!\.\.(/static)!$1!gm' "$line"
fi fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment