From 475ada3d6cd81f9200ae082a91281467b1da9bcc Mon Sep 17 00:00:00 2001 From: James Hodgkinson Date: Thu, 28 Apr 2022 13:45:48 +1000 Subject: [PATCH] Docs updates to push all tagged versions + dev (#720) * docs magic * more docs magic * did I mention I really dislike YAML? * updatey scripty boopydoopy * lock docs down to master * put the symlinked versions up the top of the list * updated readme --- .github/workflows/kanidm_book.yml | 14 +++++--- Makefile | 13 +++++++ README.md | 13 +++---- build_all_the_docs.sh | 59 +++++++++++++++++++++++++++++++ 4 files changed, 89 insertions(+), 10 deletions(-) create mode 100755 build_all_the_docs.sh diff --git a/.github/workflows/kanidm_book.yml b/.github/workflows/kanidm_book.yml index 5e2229155..4b30cb6b6 100644 --- a/.github/workflows/kanidm_book.yml +++ b/.github/workflows/kanidm_book.yml @@ -1,17 +1,21 @@ name: GitHub Pages -on: +"on": push: branches: - master + jobs: deploy_book: runs-on: ubuntu-latest concurrency: group: ${{ github.workflow }}-${{ github.ref }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + clean: false - name: Install deps run: | @@ -32,8 +36,10 @@ jobs: - uses: actions-rs/cargo@v1 - - name: Run make book - run: make book + - name: Make all the books + run: | + export + ./build_all_the_docs.sh - name: Deploy uses: peaceiris/actions-gh-pages@v3 diff --git a/Makefile b/Makefile index 356d6ff3b..7705f1888 100644 --- a/Makefile +++ b/Makefile @@ -79,6 +79,19 @@ book: mkdir -p ./docs/rustdoc/${BOOK_VERSION} mv ./target/doc/* ./docs/rustdoc/${BOOK_VERSION}/ +book_versioned: + echo "Book version: ${BOOK_VERSION}" + rm -rf ./target/doc + git switch -c "${BOOK_VERSION}" + git pull origin "${BOOK_VERSION}" + cargo doc --no-deps --quiet + mdbook build kanidm_book + mkdir -p ./docs + mv ./kanidm_book/book/ ./docs/${BOOK_VERSION}/ + mkdir -p ./docs/${BOOK_VERSION}/rustdoc/ + mv ./target/doc/* ./docs/${BOOK_VERSION}/rustdoc/ + git switch master + clean_book: rm -rf ./docs diff --git a/README.md b/README.md index fdecb1c15..0e4b0e7a7 100644 --- a/README.md +++ b/README.md @@ -18,12 +18,13 @@ treated as such. ## Documentation / Getting Started / Install -If you want to deploy Kanidm to see what it can do, you should read the [kanidm book] +If you want to deploy Kanidm to see what it can do, you should read the kanidm book. -We also publish limited [support guidelines]. +- [Kanidm book (Latest commit)](https://kanidm.github.io/kanidm/master/) +- [Kanidm book (Latest stable)](https://kanidm.github.io/kanidm/stable/) -[kanidm book]: https://kanidm.github.io/kanidm/ -[support guidelines]: https://github.com/kanidm/kanidm/blob/master/project_docs/RELEASE_AND_SUPPORT.md + +We also publish limited [support guidelines](https://github.com/kanidm/kanidm/blob/master/project_docs/RELEASE_AND_SUPPORT.md)). ## Code of Conduct / Ethics @@ -47,14 +48,14 @@ If you want to develop on the server, there is a getting started [guide for deve is a diverse topic and we encourage contributions of many kinds in the project, from people of all backgrounds. -[guide for developers]: https://github.com/kanidm/kanidm/blob/master/DEVELOPER_README.md +[guide for developers]: https://kanidm.github.io/kanidm/master/DEVELOPER_README.html ## Features ### Implemented * SSH key distribution for servers -* Pam/nsswitch clients (with limited offline auth) +* PAM/nsswitch clients (with limited offline auth) * MFA - TOTP * Highly concurrent design (MVCC, COW) * RADIUS integration diff --git a/build_all_the_docs.sh b/build_all_the_docs.sh new file mode 100755 index 000000000..605956e66 --- /dev/null +++ b/build_all_the_docs.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +git config --global pull.ff only +export CARGO_TARGET_DIR="${TMPDIR}cargo_target" +DOCS_DIR="/tmp/kanidm_docs" + +echo "DOCS DIR: ${DOCS_DIR}" +echo "PWD: $(pwd)" + +function build_version() { + BOOK_VERSION=$1 + echo "Book version: ${BOOK_VERSION}" + echo "
  • ${BOOK_VERSION}
  • " >> "${DOCS_DIR}/index.html" + git switch -c "${BOOK_VERSION}" + git pull origin "${BOOK_VERSION}" + RUSTFLAGS=-Awarnings cargo doc --quiet --no-deps + mdbook build kanidm_book + mv ./kanidm_book/book/ "${DOCS_DIR}/${BOOK_VERSION}/" + mkdir -p "${DOCS_DIR}/${BOOK_VERSION}/rustdoc/" + mv ./target/doc/* "${DOCS_DIR}/${BOOK_VERSION}/rustdoc/" +} + +mkdir -p "${DOCS_DIR}" + +cat > "${DOCS_DIR}/index.html" <<-'EOM' + + +kanidm docs root + + +

    Kanidm docs

    + + + +EOM +ls -la "${DOCS_DIR}" + +mv "${DOCS_DIR}" ./docs/ +ln -s "${LATEST}" ./docs/stable