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
This commit is contained in:
James Hodgkinson 2022-04-28 13:45:48 +10:00 committed by GitHub
parent a58edc5128
commit 475ada3d6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 89 additions and 10 deletions

View file

@ -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

View file

@ -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

View file

@ -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

59
build_all_the_docs.sh Executable file
View file

@ -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 "<li><a href=\"/kanidm/${BOOK_VERSION}\">${BOOK_VERSION}</a></li>" >> "${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'
<html>
<head>
<title>kanidm docs root</title>
</head>
<body>
<h1>Kanidm docs</h1>
<ul>
EOM
LATEST="$(git tag -l 'v*' --sort "-version:refname" | grep -v '1.1.0alpha' | head -n1)"
{
echo "<li><strong><a href=\"/kanidm/master/\">Latest Dev Version</a></strong></li>"
echo "<li><strong><a href=\"/kanidm/stable/\">Latest Stable Version (${LATEST})</a></strong></li>"
} >> "${DOCS_DIR}/index.html"
# build the current head
build_version master
# build all the other versions
for version in $(git tag -l 'v*' --sort "-version:refname" | grep -v '1.1.0alpha'); do
echo "$version"
build_version "${version}"
done
cat >> "${DOCS_DIR}/index.html" <<-'EOM'
</ul>
</body>
</html>
EOM
ls -la "${DOCS_DIR}"
mv "${DOCS_DIR}" ./docs/
ln -s "${LATEST}" ./docs/stable