From 636a19b2126ffe78d209eb6a7aedef857abd2539 Mon Sep 17 00:00:00 2001 From: Mary Anthony Date: Wed, 1 Apr 2015 11:28:34 -0700 Subject: [PATCH] Retooling to allow for docs build Adding docs build to the Makefile Adding in Sven's changes to the Makefile Removing DS_store file Updating per Stephen's comments Update with Stephen's final comment Signed-off-by: Mary Anthony --- AUTHORS | 1 + Makefile | 20 +++++++++++++++++++- docs/Dockerfile | 17 +++++++++++++++++ {doc => docs}/architecture.md | 0 {doc => docs}/configuration.md | 0 {doc => docs}/deploying.md | 0 {doc => docs}/glossary.md | 0 docs/install.md | 0 docs/mkdocs.yml | 6 ++++++ {doc => docs}/notifications.md | 0 {doc => docs}/overview.md | 0 {doc => docs}/spec/api.md | 0 {doc => docs}/spec/api.md.tmpl | 0 {doc => docs}/spec/auth/token.md | 0 {doc => docs}/spec/json.md | 0 {doc => docs}/storagedriver/azure.md | 0 {doc => docs}/storagedriver/filesystem.md | 0 {doc => docs}/storagedriver/inmemory.md | 0 {doc => docs}/storagedriver/s3.md | 0 {doc => docs}/storagedrivers.md | 0 20 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 docs/Dockerfile rename {doc => docs}/architecture.md (100%) rename {doc => docs}/configuration.md (100%) rename {doc => docs}/deploying.md (100%) rename {doc => docs}/glossary.md (100%) create mode 100644 docs/install.md create mode 100644 docs/mkdocs.yml rename {doc => docs}/notifications.md (100%) rename {doc => docs}/overview.md (100%) rename {doc => docs}/spec/api.md (100%) rename {doc => docs}/spec/api.md.tmpl (100%) rename {doc => docs}/spec/auth/token.md (100%) rename {doc => docs}/spec/json.md (100%) rename {doc => docs}/storagedriver/azure.md (100%) rename {doc => docs}/storagedriver/filesystem.md (100%) rename {doc => docs}/storagedriver/inmemory.md (100%) rename {doc => docs}/storagedriver/s3.md (100%) rename {doc => docs}/storagedrivers.md (100%) diff --git a/AUTHORS b/AUTHORS index 749f0af7..ac5c0cce 100644 --- a/AUTHORS +++ b/AUTHORS @@ -18,3 +18,4 @@ Shreyas Karnik Stephen J Day Tianon Gravi xiekeyang +Mary Anthony diff --git a/Makefile b/Makefile index e75d375b..b1a26b86 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,8 @@ PREFIX?=$(shell pwd) # Used to populate version variable in main package. -GO_LDFLAGS=-ldflags "-X `go list ./version`.Version `git describe --match 'v[0-9]*' --dirty='.m' --always`" +VERSION=$(shell git describe --match 'v[0-9]*' --dirty='.m' --always) +GO_LDFLAGS=-ldflags "-X `go list ./version`.Version $(VERSION)" .PHONY: clean all fmt vet lint build test binaries .DEFAULT: default @@ -61,3 +62,20 @@ binaries: ${PREFIX}/bin/registry ${PREFIX}/bin/registry-api-descriptor-template clean: @echo "+ $@" @rm -rf "${PREFIX}/bin/registry" "${PREFIX}/bin/registry-api-descriptor-template" + + +# Use the existing docs build cmds from docker/docker +# Later, we will move this into an import +DOCS_MOUNT := $(if $(DOCSDIR),-v $(CURDIR)/$(DOCSDIR):/$(DOCSDIR)) +DOCSPORT := 8000 +DOCKER_DOCS_IMAGE := docker-docs-$(VERSION) +DOCKER_RUN_DOCS := docker run --rm -it $(DOCS_MOUNT) -e AWS_S3_BUCKET -e NOCACHE + +docs: docs-build + $(DOCKER_RUN_DOCS) -p $(DOCSPORT):8000 "$(DOCKER_DOCS_IMAGE)" mkdocs serve + +docs-shell: docs-build + $(DOCKER_RUN_DOCS) -p $(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 00000000..83aa1e7b --- /dev/null +++ b/docs/Dockerfile @@ -0,0 +1,17 @@ +FROM docs/base:latest +MAINTAINER Mary (@moxiegirl) + +# 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 git describe --match 'v[0-9]*' --dirty='.m' --always > /docs/VERSION +COPY docs/* /docs/sources/distribution/ +COPY docs/mkdocs.yml /docs/mkdocs-distribution.yml + +# Then build everything together, ready for mkdocs +RUN /docs/build.sh diff --git a/doc/architecture.md b/docs/architecture.md similarity index 100% rename from doc/architecture.md rename to docs/architecture.md diff --git a/doc/configuration.md b/docs/configuration.md similarity index 100% rename from doc/configuration.md rename to docs/configuration.md diff --git a/doc/deploying.md b/docs/deploying.md similarity index 100% rename from doc/deploying.md rename to docs/deploying.md diff --git a/doc/glossary.md b/docs/glossary.md similarity index 100% rename from doc/glossary.md rename to docs/glossary.md diff --git a/docs/install.md b/docs/install.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml new file mode 100644 index 00000000..c9606e7b --- /dev/null +++ b/docs/mkdocs.yml @@ -0,0 +1,6 @@ + +- ['distribution/overview.md', 'User Guide', 'Docker Distribution' ] +- ['distribution/install.md', 'Installation', 'Docker Distribution'] +- ['distribution/architecture.md', 'Reference', 'Distribution Architecture'] + + diff --git a/doc/notifications.md b/docs/notifications.md similarity index 100% rename from doc/notifications.md rename to docs/notifications.md diff --git a/doc/overview.md b/docs/overview.md similarity index 100% rename from doc/overview.md rename to docs/overview.md diff --git a/doc/spec/api.md b/docs/spec/api.md similarity index 100% rename from doc/spec/api.md rename to docs/spec/api.md diff --git a/doc/spec/api.md.tmpl b/docs/spec/api.md.tmpl similarity index 100% rename from doc/spec/api.md.tmpl rename to docs/spec/api.md.tmpl diff --git a/doc/spec/auth/token.md b/docs/spec/auth/token.md similarity index 100% rename from doc/spec/auth/token.md rename to docs/spec/auth/token.md diff --git a/doc/spec/json.md b/docs/spec/json.md similarity index 100% rename from doc/spec/json.md rename to docs/spec/json.md diff --git a/doc/storagedriver/azure.md b/docs/storagedriver/azure.md similarity index 100% rename from doc/storagedriver/azure.md rename to docs/storagedriver/azure.md diff --git a/doc/storagedriver/filesystem.md b/docs/storagedriver/filesystem.md similarity index 100% rename from doc/storagedriver/filesystem.md rename to docs/storagedriver/filesystem.md diff --git a/doc/storagedriver/inmemory.md b/docs/storagedriver/inmemory.md similarity index 100% rename from doc/storagedriver/inmemory.md rename to docs/storagedriver/inmemory.md diff --git a/doc/storagedriver/s3.md b/docs/storagedriver/s3.md similarity index 100% rename from doc/storagedriver/s3.md rename to docs/storagedriver/s3.md diff --git a/doc/storagedrivers.md b/docs/storagedrivers.md similarity index 100% rename from doc/storagedrivers.md rename to docs/storagedrivers.md