|
|
@@ -15,6 +15,9 @@
|
|
|
DOCKER ?= docker
|
|
|
MKDOCS_IMAGE ?= github.com/external-secrets-mkdocs:latest
|
|
|
MKDOCS ?= mkdocs
|
|
|
+MIKE ?= mike
|
|
|
+DOCS_VERSION ?= main
|
|
|
+DOCS_ALIAS ?= unstable
|
|
|
SERVE_BIND_ADDRESS ?= 127.0.0.1
|
|
|
|
|
|
# TOP is the current directory where this Makefile lives.
|
|
|
@@ -45,13 +48,23 @@ image:
|
|
|
build: image generate $(SOURCES)
|
|
|
mkdir -p $(GENROOT)
|
|
|
$(DOCKER) run \
|
|
|
- --mount type=bind,source=$(SRCDIR),target=/docs \
|
|
|
- --mount type=bind,source=$(CFGFILE),target=/mkdocs.yml \
|
|
|
- --mount type=bind,source=$(GENROOT),target=/site \
|
|
|
+ --mount type=bind,source=$(ROOT),target=/repo \
|
|
|
--sig-proxy=true \
|
|
|
--rm \
|
|
|
+ --user $(UID):$(GID) \
|
|
|
$(MKDOCS_IMAGE) \
|
|
|
- /bin/bash -c "cd / && $(MKDOCS) build; find /site -exec chown $(UID):$(GID) {} \;"
|
|
|
+ /bin/bash -c "cd /repo && git config user.name "Docs" && git config user.email "docs@external-secrets.io" && $(MIKE) deploy --update-aliases -F hack/api-docs/mkdocs.yml $(DOCS_VERSION) $(DOCS_ALIAS);"
|
|
|
+
|
|
|
+.PHONY: build.publish
|
|
|
+build.publish: image generate $(SOURCES)
|
|
|
+ mkdir -p $(GENROOT)
|
|
|
+ $(DOCKER) run \
|
|
|
+ --mount type=bind,source=$(ROOT),target=/repo \
|
|
|
+ --sig-proxy=true \
|
|
|
+ --rm \
|
|
|
+ --user $(UID):$(GID) \
|
|
|
+ $(MKDOCS_IMAGE) \
|
|
|
+ /bin/bash -c "cd /repo && git config user.name "Docs" && git config user.email "docs@external-secrets.io" && $(MIKE) deploy --update-aliases -p -F hack/api-docs/mkdocs.yml $(DOCS_VERSION) $(DOCS_ALIAS);"
|
|
|
|
|
|
.PHONY: generate
|
|
|
generate:
|
|
|
@@ -64,14 +77,13 @@ clean:
|
|
|
# serve runs mkdocs as a local webserver for interactive development.
|
|
|
# This will serve the live copy of the docs on 127.0.0.1:8000.
|
|
|
.PHONY: serve
|
|
|
-serve: build
|
|
|
+serve:
|
|
|
$(DOCKER) run \
|
|
|
-it \
|
|
|
--sig-proxy=true \
|
|
|
- --mount type=bind,source=$(SRCDIR),target=/docs \
|
|
|
- --mount type=bind,source=$(CFGFILE),target=/mkdocs.yml \
|
|
|
- --mount type=bind,source=$(GENROOT),target=/site \
|
|
|
+ --mount type=bind,source=$(ROOT),target=/repo \
|
|
|
+ --user $(UID):$(GID) \
|
|
|
-p $(SERVE_BIND_ADDRESS):8000:8000 \
|
|
|
--rm \
|
|
|
$(MKDOCS_IMAGE) \
|
|
|
- /bin/bash -c "cd / && $(MKDOCS) serve -a 0.0.0.0:8000"
|
|
|
+ /bin/bash -c "cd /repo && $(MIKE) serve -F hack/api-docs/mkdocs.yml -a 0.0.0.0:8000"
|