1
0
Fork 0
mirror of https://github.com/containers/ansible-podman-collections.git synced 2026-02-04 07:11:49 +00:00

Add docs generation (#196)

This commit is contained in:
Sergey 2021-02-14 11:37:11 +02:00 committed by GitHub
parent 6ee8848310
commit dfae85ecad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 41 additions and 31 deletions

View file

@ -1,11 +1,25 @@
#!/bin/bash
#!/usr/bin/bash
DOCS_DIR=${1:-/tmp/docs}
DOCS=${1:-$HOME/podman-docs}
HTML=${2:-/tmp/html}
DOCS_TMP=${3:-/tmp/docs}
mkdir -p $DOCS_DIR
chmod g-w $DOCS_DIR
antsibull-docs collection --use-current --squash-hierarchy --dest-dir $DOCS_DIR containers.podman
cd $DOCS_DIR
# Build current collection
rm -rf /tmp/docs_new_collection
ansible-galaxy collection build --output-path /tmp/docs_new_collection --force
pkg=$(ls -t /tmp/docs_new_collection/* | head -1)
ansible-galaxy collection install -vvv --force $pkg -p /tmp/docs_new_path
pushd /tmp/docs_new_path/ansible_collections/containers/podman
mkdir -p $DOCS_TMP
chmod g-w $DOCS_TMP
ANSIBLE_COLLECTIONS_PATH=../../../ antsibull-docs collection --use-current --squash-hierarchy --dest-dir $DOCS_TMP containers.podman
cd $DOCS_TMP
echo "extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx_antsibull_ext']" > conf.py
sphinx-build . $HTML
rm -rf "$HTML/_sources" "$HTML/.buildinfo" "$HTML/.doctrees"
popd
cp -r $HTML/* $DOCS/