docs: add code for building docs in ci
This commit is contained in:
1 parent
08b77b62d4
commit
f7905b4943
6 files changed
+95
No files matched your search
@@ -7,6 +7,8 @@ build
|
|||||||
docs
|
docs
|
||||||
tests
|
tests
|
||||||
!build/package/*
|
!build/package/*
|
||||||
|
!docs/_build/entrypoint
|
||||||
|
!docs/_build/requirements.txt
|
||||||
!tests/dhparam.pem
|
!tests/dhparam.pem
|
||||||
!contrib/bash-completion
|
!contrib/bash-completion
|
||||||
!contrib/docker
|
!contrib/docker
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ include common.mk
|
|||||||
|
|
||||||
.PHONY: all apt-update install version copyfiles copyplugin man-db plugins dependencies docker-image-labeler lambda-builder netrc sshcommand procfile-util plugn docker aufs stack count vagrant-acl-add vagrant-dokku go-build
|
.PHONY: all apt-update install version copyfiles copyplugin man-db plugins dependencies docker-image-labeler lambda-builder netrc sshcommand procfile-util plugn docker aufs stack count vagrant-acl-add vagrant-dokku go-build
|
||||||
|
|
||||||
|
include docs.mk
|
||||||
include tests.mk
|
include tests.mk
|
||||||
include package.mk
|
include package.mk
|
||||||
include deb.mk
|
include deb.mk
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
.PHONY: docs-build-image
|
||||||
|
docs-build-image:
|
||||||
|
docker build -f docs/_build/Dockerfile --progress plain -t app/mkdocs .
|
||||||
|
|
||||||
|
.PHONY: docs-build
|
||||||
|
docs-build:
|
||||||
|
docker run --rm -p 3487:3487 -v "$(PWD):/usr/src/source" --name docs-serve app/mkdocs build
|
||||||
|
|
||||||
|
.PHONY: docs-serve
|
||||||
|
docs-serve:
|
||||||
|
docker run --rm -p 3487:3487 -v "$(PWD):/usr/src/source" --name docs-serve app/mkdocs serve
|
||||||
|
|
||||||
|
.PHONY: docs-deps
|
||||||
|
docs-deps:
|
||||||
|
@docker run --rm -p 3487:3487 -v "$(PWD):/usr/src/app" app/mkdocs deps
|
||||||
|
|
||||||
|
.PHONY: docs-enter
|
||||||
|
docs-enter:
|
||||||
|
docker exec -it docs-serve bash
|
||||||
Vendored
+12
@@ -0,0 +1,12 @@
|
|||||||
|
FROM python:3.10-alpine
|
||||||
|
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
|
COPY docs/_build/requirements.txt .
|
||||||
|
|
||||||
|
RUN apk add --no-cache bash yaml && \
|
||||||
|
pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
COPY docs/_build/entrypoint /bin/entrypoint
|
||||||
|
|
||||||
|
ENTRYPOINT [ "/bin/entrypoint" ]
|
||||||
+38
@@ -0,0 +1,38 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -eo pipefail
|
||||||
|
|
||||||
|
write-mkdocs() {
|
||||||
|
if [[ -f /usr/src/source/contrib/write-mkdocs ]]; then
|
||||||
|
if ! python /usr/src/source/contrib/write-mkdocs; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
main() {
|
||||||
|
declare CMD="$1" ARGS=("${@:2}")
|
||||||
|
|
||||||
|
if [[ "$CMD" == "build" ]]; then
|
||||||
|
write-mkdocs
|
||||||
|
mkdocs build
|
||||||
|
site_dir="$(grep site_dir mkdocs.yml | awk '{print $2}')"
|
||||||
|
cp -r "/usr/src/app/${site_dir}" "/usr/src/source/${site_dir}"
|
||||||
|
|
||||||
|
return $?
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$CMD" == "deps" ]]; then
|
||||||
|
pip freeze
|
||||||
|
return $?
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$CMD" == "serve" ]]; then
|
||||||
|
write-mkdocs
|
||||||
|
mkdocs serve -a 0.0.0.0:3487
|
||||||
|
return $?
|
||||||
|
fi
|
||||||
|
|
||||||
|
"$CMD" "${ARGS[@]}"
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
||||||
Vendored
+23
@@ -0,0 +1,23 @@
|
|||||||
|
beautifulsoup4==4.11.1
|
||||||
|
click==8.1.3
|
||||||
|
ghp-import==2.1.0
|
||||||
|
importlib-metadata==4.12.0
|
||||||
|
Jinja2==3.1.2
|
||||||
|
Markdown==3.3.7
|
||||||
|
MarkupSafe==2.1.1
|
||||||
|
mergedeep==1.3.4
|
||||||
|
mkdocs==1.3.1
|
||||||
|
mkdocs-material==8.4.2
|
||||||
|
mkdocs-material-extensions==1.0.3
|
||||||
|
packaging==21.3
|
||||||
|
Pygments==2.13.0
|
||||||
|
pymdown-extensions==9.5
|
||||||
|
pyparsing==3.0.9
|
||||||
|
python-dateutil==2.8.2
|
||||||
|
PyYAML==6.0
|
||||||
|
pyyaml_env_tag==0.1
|
||||||
|
six==1.16.0
|
||||||
|
soupsieve==2.3.2.post1
|
||||||
|
watchdog==2.1.9
|
||||||
|
zipp==3.8.1
|
||||||
|
mkdocs-exclude
|
||||||
Reference in new issue
Block a user