From 80851aa53b2e3b5ca314281e2f2d0acb2880cb02 Mon Sep 17 00:00:00 2001 From: Sven Dowideit Date: Fri, 20 Feb 2015 13:20:54 +1000 Subject: [PATCH] Add the docs.docker.com build tooling Signed-off-by: Sven Dowideit --- Makefile | 16 ++++++++++++++++ docs/Dockerfile | 15 +++++++++++++++ docs/mkdocs.yml | 2 ++ 3 files changed, 33 insertions(+) create mode 100644 docs/Dockerfile create mode 100644 docs/mkdocs.yml diff --git a/Makefile b/Makefile index 7b869a808f..f9b6fd83f7 100644 --- a/Makefile +++ b/Makefile @@ -15,3 +15,19 @@ validate: validate-dco validate-gofmt build: script/build + +# import the existing docs build cmds from docker/docker +DOCS_MOUNT := $(if $(DOCSDIR),-v $(CURDIR)/$(DOCSDIR):/$(DOCSDIR)) +DOCSPORT := 8000 +GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null) +DOCKER_DOCS_IMAGE := dhe-docs$(if $(GIT_BRANCH),:$(GIT_BRANCH)) +DOCKER_RUN_DOCS := docker run --rm -it $(DOCS_MOUNT) -e AWS_S3_BUCKET -e NOCACHE + +docs: docs-build + $(DOCKER_RUN_DOCS) -p $(if $(DOCSPORT),$(DOCSPORT):)8000 "$(DOCKER_DOCS_IMAGE)" mkdocs serve + +docs-shell: docs-build + $(DOCKER_RUN_DOCS) -p $(if $(DOCSPORT),$(DOCSPORT):)8000 "$(DOCKER_DOCS_IMAGE)" bash + +docs-build: + docker build -t "$(DOCKER_DOCS_IMAGE)" -f docs/Dockerfile . diff --git a/docs/Dockerfile b/docs/Dockerfile new file mode 100644 index 0000000000..e075abec80 --- /dev/null +++ b/docs/Dockerfile @@ -0,0 +1,15 @@ +FROM docs/base:latest +MAINTAINER Sven Dowideit (@SvenDowideit) + +# to get the git info for this repo +COPY . /src + +# Reset the /docs dir so we can replace the theme meta with the new repo's git info +RUN git reset --hard + +RUN grep VERSION /src/version.go | sed 's/.*"\(.*\)".*/\1/' > /docs/VERSION +COPY docs/* /docs/sources/machine/ +COPY docs/mkdocs.yml /docs/mkdocs-machine.yml + +# Then build everything together, ready for mkdocs +RUN /docs/build.sh diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml new file mode 100644 index 0000000000..5d9c07e631 --- /dev/null +++ b/docs/mkdocs.yml @@ -0,0 +1,2 @@ + +- ['machine/dockermachine.md', 'User Guide', 'Docker Machine' ]