From 2b310fd64de8880f063d992b0573cd67cf23400c Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Thu, 23 Mar 2017 16:31:21 +0100 Subject: [PATCH] integrate caching of plugins --- Documentation/Books/Makefile | 6 +++++- scripts/generateDocumentation.sh | 36 ++++++++++++++++++++++++-------- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/Documentation/Books/Makefile b/Documentation/Books/Makefile index 720134b2be..6c93133869 100644 --- a/Documentation/Books/Makefile +++ b/Documentation/Books/Makefile @@ -292,7 +292,11 @@ build-book: make ppbook-check-directory-link make book-check-images-referenced - cd ppbooks/$(NAME) && gitbook install + if test -n $(NODE_MODLUES_DIR); then \ + cp -a $(NODE_MODLUES_DIR) ppbooks/$(NAME); \ + else \ + cd ppbooks/$(NAME); gitbook install -g ; \ + fi cd ppbooks/$(NAME) && gitbook build ./ ./../../books/$(NAME) rm -f ./books/$(NAME)/HEADER.html python ../Scripts/deprecated.py diff --git a/scripts/generateDocumentation.sh b/scripts/generateDocumentation.sh index f60dd94b85..bd004adf00 100755 --- a/scripts/generateDocumentation.sh +++ b/scripts/generateDocumentation.sh @@ -40,26 +40,44 @@ test_tools(){ main(){ #test for basic tools test_tools - - ./scripts/build-deb.sh --buildDir build-docu --parallel 2 - - # we expect this to be a symlink, so no -r ;-) - rm -f build - ln -s build-docu build - ./utils/generateExamples.sh + TARGET=$1 + shift + if test -z "$TARGET"; then + ./scripts/build-deb.sh --buildDir build-docu --parallel 2 + + # we expect this to be a symlink, so no -r ;-) + rm -f build + ln -s build-docu build + + ./utils/generateExamples.sh + fi ./utils/generateSwagger.sh cd Documentation/Books - make build-dist-books OUTPUT_DIR=/build/build-docu + if test -z "$TARGET"; then + make build-dist-books OUTPUT_DIR=/build/build-docu NODE_MODLUES_DIR=/tmp/1/node_modules + else + make build-book NAME=$TARGET OUTPUT_DIR=/build/build-docu NODE_MODLUES_DIR=/tmp/1/node_modules $@ + fi } if test "$1" != "docker"; then + cd "$(dirname "${BASH_SOURCE[0]}")/.." pwd + + N=`basename $0` + if test "$N" != generateDocumentation.sh; then + DOCTarget=`echo $N | sed "s;.sh;;"` + cd .. + fi WD=`pwd` - docker run -it --volume ${WD}:/build arangodb/documentation-builder /bin/bash /build/scripts/generateDocumentation.sh docker $@ + + docker pull arangodb/documentation-builder + docker run -it --volume ${WD}:/build arangodb/documentation-builder /bin/bash /build/scripts/generateDocumentation.sh docker $DOCTarget $@ else cd /build + shift main "$@" fi