diff --git a/Dockerfile b/Dockerfile index bc50fa6..781dfb7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,8 @@ RUN apt update && apt -y install sshpass rsync doxygen nodejs npm xdot xdotool WORKDIR /usr/local RUN npm install docusaurus +RUN wget -qO- 'https://github.com/rust-lang/mdBook/releases/download/v0.4.25/mdbook-v0.4.25-x86_64-unknown-linux-gnu.tar.gz' | tar xvz -C /usr/local/bin + RUN mkdir -p /root/.ssh COPY ./id_rsa /root/.ssh/ RUN chmod 700 /root/.ssh && chmod 600 /root/.ssh/* @@ -14,4 +16,4 @@ COPY entrypoint.sh / COPY generators /generators RUN chmod +x /entrypoint.sh -ENTRYPOINT [ "/entrypoint.sh" ] \ No newline at end of file +ENTRYPOINT [ "/entrypoint.sh" ] diff --git a/generators/mdbook.sh b/generators/mdbook.sh new file mode 100644 index 0000000..e11e0b2 --- /dev/null +++ b/generators/mdbook.sh @@ -0,0 +1,14 @@ +GEN_PATH="/docs/book" + +generate() { + + if [ ! -f "$1"/book.toml ]; then + echo "doxygen generator error : file $1/book.toml is missing" >&2 + exit 1 + fi + + (cd "$1" && mdbook build) + + mkdir -p $GEN_PATH + mv "$1"/book/* $GEN_PATH +}