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