Build local docs

This commit is contained in:
TheSpad 2023-05-14 21:42:32 +01:00
parent 8e803163b0
commit 30389889b6
No known key found for this signature in database
GPG Key ID: 08F06191F4587860
3 changed files with 10 additions and 0 deletions

View File

@ -59,6 +59,7 @@ app_setup_block: |
# changelog
changelogs:
- { date: "14.05.23:", desc: "Build local docs on first run." }
- { date: "05.03.23:", desc: "Rebase to Alpine 3.17." }
- { date: "02.11.22:", desc: "Rebase to Alpine 3.16, migrate to s6v3." }
- { date: "01.08.22:", desc: "Remove py3-pillow, add tiff to fix deps." }

View File

@ -6,6 +6,7 @@ plugin = python3
module = netbox.wsgi:application
static-map = /static=static
static-gzip-dir = static/CACHE
static-index = index.html
hook-pre-app = exec:/usr/bin/python3 ./manage.py collectstatic --noinput
hook-pre-app = exec:/usr/bin/python3 ./manage.py remove_stale_contenttypes --no-input
hook-pre-app = exec:/usr/bin/python3 ./manage.py clearsessions

View File

@ -49,6 +49,14 @@ ln -sf /config/configuration.py /app/netbox/netbox/netbox/configuration.py
mv /defaults/uwsgi.ini /app/netbox/netbox/uwsgi.ini > /dev/null 2>&1
# build docs
if [[ ! -e "/app/netbox/netbox/project-static/docs/index.html" ]]; then
cd /app/netbox || exit 1
echo "Building local documentation"
mkdocs build
cd /app/netbox/netbox || exit 1
fi
# permissions
lsiown -R abc:abc \
/app/netbox/netbox/static \