From 3d85acaf68b49205331fe3b9c97cfb63a3d413e4 Mon Sep 17 00:00:00 2001 From: Arthur Golubtsov Date: Mon, 19 Nov 2018 18:48:48 +0300 Subject: [PATCH] Generate documentation pages via Gitbook toolchain and serve them with monkey-server --- builder/assets/index.html | 2 ++ builder/image-build.sh | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/builder/assets/index.html b/builder/assets/index.html index 9c3074ca..1e7e2ad7 100644 --- a/builder/assets/index.html +++ b/builder/assets/index.html @@ -4,10 +4,12 @@
  • View image topics (web_video_server)
  • Open web terminal (Butterfly)
  • +
  • Documentation (gitbook)
  • diff --git a/builder/image-build.sh b/builder/image-build.sh index 27656508..da6a994d 100755 --- a/builder/image-build.sh +++ b/builder/image-build.sh @@ -84,6 +84,15 @@ ${BUILDER_DIR}/image-chroot.sh ${IMAGE_PATH} exec ${SCRIPTS_DIR}'/image-init.sh' ${BUILDER_DIR}/image-chroot.sh ${IMAGE_PATH} copy ${SCRIPTS_DIR}'/assets/monkey-clever' '/root/' ${BUILDER_DIR}/image-chroot.sh ${IMAGE_PATH} copy ${SCRIPTS_DIR}'/assets/index.html' '/usr/share/monkey-static/' +# Gitbook +apt-get install -y curl gnupg +curl -sL https://deb.nodesource.com/setup_11.x | bash - +apt-get install -y nodejs +npm install gitbook-cli -g +gitbook build ${REPO_DIR}'/docs' +${BUILDER_DIR}/image-chroot.sh ${IMAGE_PATH} copy ${REPO_DIR}'/docs/_book/' '/usr/share/monkey-static/docs/' + + # Butterfly ${BUILDER_DIR}/image-chroot.sh ${IMAGE_PATH} copy ${SCRIPTS_DIR}'/assets/butterfly.service' '/lib/systemd/system/' ${BUILDER_DIR}/image-chroot.sh ${IMAGE_PATH} copy ${SCRIPTS_DIR}'/assets/butterfly.socket' '/lib/systemd/system/'