Merge pull request #631 from moxiegirl/test-tooling

Updating for new docs build and tooling infrastructure 1.7 release; Thank you Olivier. I promise to look at all of this after Dockercon.  We'll make it perfect.
This commit is contained in:
moxiegirl 2015-06-15 17:57:25 -07:00
commit 020bd0b45f
23 changed files with 249 additions and 140 deletions

View file

@ -64,18 +64,3 @@ clean:
@rm -rf "${PREFIX}/bin/registry" "${PREFIX}/bin/registry-api-descriptor-template" @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 .

View file

@ -1,37 +1,24 @@
FROM docs/base:latest FROM docs/base:hugo
MAINTAINER Mary <mary@docker.com> (@moxiegirl) MAINTAINER Mary Anthony <mary@docker.com> (@moxiegirl)
# to get the git info for this repo # To get the git info for this repo
COPY . /src COPY . /src
# Reset the /docs dir so we can replace the theme meta with the new repo's git info COPY . /docs/content/distribution/
RUN git reset --hard
RUN grep "VERSION =" /src/version/version.go | sed 's/.*"\(.*\)".*/\1/' > /docs/VERSION
# Sed to process GitHub Markdown
# 1-2 Remove comment code from metadata block
# 3 Remove .md extension from link text
# 4 Change ](/ to ](/project/ in links
# 5 Change ](word) to ](/project/word)
# 6 Change ](../../ to ](/project/
# 7 Change ](../ to ](/project/word)
# #
# RUN git describe --match 'v[0-9]*' --dirty='.m' --always > /docs/VERSION
# The above line causes a floating point error in our tools
# #
COPY docs/* /docs/sources/registry/ RUN find /docs/content/distribution -type f -name "*.md" -exec sed -i.old \
COPY docs/images/* /docs/sources/registry/images/ -e '/^<!.*metadata]>/g' \
COPY docs/spec/* /docs/sources/registry/spec/ -e '/^<!.*end-metadata.*>/g' \
COPY docs/spec/auth/* /docs/sources/registry/spec/auth/ -e 's/\([(]\)\(.*\)\(\.md\)/\1\2/g' \
COPY docs/storage-drivers/* /docs/sources/registry/storage-drivers/ -e 's/\(\]\)\([(]\)\(\/\)/\1\2\/distribution\//g' \
COPY docs/mkdocs.yml /docs/mkdocs-distribution.yml -e 's/\(\][(]\)\([A-z]*[)]\)/\]\(\/distribution\/\2/g' \
-e 's/\(\][(]\)\(\.\.\/\)/\1\/distribution\//g' {} \;
RUN sed -i.old '1s;^;no_version_dropdown: true;' \
/docs/sources/registry/*.md \
/docs/sources/registry/spec/*.md \
/docs/sources/registry/spec/auth/*.md \
/docs/sources/registry/storage-drivers/*.md
RUN sed -i.old -e '/^<!--GITHUB/g' -e '/^IGNORES-->/g'\
/docs/sources/registry/*.md \
/docs/sources/registry/spec/*.md \
/docs/sources/registry/spec/auth/*.md \
/docs/sources/registry/storage-drivers/*.md
# Then build everything together, ready for mkdocs
RUN /docs/build.sh

55
docs/Makefile Normal file
View file

@ -0,0 +1,55 @@
.PHONY: all binary build cross default docs docs-build docs-shell shell test test-unit test-integration test-integration-cli test-docker-py validate
# env vars passed through directly to Docker's build scripts
# to allow things like `make DOCKER_CLIENTONLY=1 binary` easily
# `docs/sources/contributing/devenvironment.md ` and `project/PACKAGERS.md` have some limited documentation of some of these
DOCKER_ENVS := \
-e BUILDFLAGS \
-e DOCKER_CLIENTONLY \
-e DOCKER_EXECDRIVER \
-e DOCKER_GRAPHDRIVER \
-e TESTDIRS \
-e TESTFLAGS \
-e TIMEOUT
# note: we _cannot_ add "-e DOCKER_BUILDTAGS" here because even if it's unset in the shell, that would shadow the "ENV DOCKER_BUILDTAGS" set in our Dockerfile, which is very important for our official builds
# to allow `make DOCSDIR=docs docs-shell` (to create a bind mount in docs)
DOCS_MOUNT := $(if $(DOCSDIR),-v $(CURDIR)/$(DOCSDIR):/$(DOCSDIR))
# to allow `make DOCSPORT=9000 docs`
DOCSPORT := 8000
# Get the IP ADDRESS
DOCKER_IP=$(shell python -c "import urlparse ; print urlparse.urlparse('$(DOCKER_HOST)').hostname or ''")
HUGO_BASE_URL=$(shell test -z "$(DOCKER_IP)" && echo localhost || echo "$(DOCKER_IP)")
HUGO_BIND_IP=0.0.0.0
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
DOCKER_IMAGE := docker$(if $(GIT_BRANCH),:$(GIT_BRANCH))
DOCKER_DOCS_IMAGE := docs-base$(if $(GIT_BRANCH),:$(GIT_BRANCH))
DOCKER_RUN_DOCS := docker run --rm -it $(DOCS_MOUNT) -e AWS_S3_BUCKET -e NOCACHE
# for some docs workarounds (see below in "docs-build" target)
GITCOMMIT := $(shell git rev-parse --short HEAD 2>/dev/null)
default: docs
docs: docs-build
$(DOCKER_RUN_DOCS) -p $(if $(DOCSPORT),$(DOCSPORT):)8000 -e DOCKERHOST "$(DOCKER_DOCS_IMAGE)" hugo server --port=$(DOCSPORT) --baseUrl=$(HUGO_BASE_URL) --bind=$(HUGO_BIND_IP)
docs-draft: docs-build
$(DOCKER_RUN_DOCS) -p $(if $(DOCSPORT),$(DOCSPORT):)8000 -e DOCKERHOST "$(DOCKER_DOCS_IMAGE)" hugo server --buildDrafts="true" --port=$(DOCSPORT) --baseUrl=$(HUGO_BASE_URL) --bind=$(HUGO_BIND_IP)
docs-shell: docs-build
$(DOCKER_RUN_DOCS) -p $(if $(DOCSPORT),$(DOCSPORT):)8000 "$(DOCKER_DOCS_IMAGE)" bash
docs-build:
# ( git remote | grep -v upstream ) || git diff --name-status upstream/release..upstream/docs ./ > ./changed-files
# echo "$(GIT_BRANCH)" > GIT_BRANCH
# echo "$(AWS_S3_BUCKET)" > AWS_S3_BUCKET
# echo "$(GITCOMMIT)" > GITCOMMIT
docker build -t "$(DOCKER_DOCS_IMAGE)" .

View file

@ -1,3 +1,9 @@
<!--[metadata]>
+++
draft = "true"
+++
<![end-metadata]-->
# Architecture # Architecture
## Design ## Design

View file

@ -1,3 +1,9 @@
<!--[metadata]>
+++
draft = "true"
+++
<![end-metadata]-->
# Build the development environment # Build the development environment
The first prequisite of properly building distribution targets is to have a Go The first prequisite of properly building distribution targets is to have a Go

View file

@ -1,8 +1,14 @@
<!--GITHUB <!--[metadata]>
page_title: Configure a Registry +++
page_description: Explains how to configure a registry title = "Configure a Registry"
page_keywords: registry, service, images, repository, configuration description = "Explains how to deploy a registry"
IGNORES--> keywords = ["registry, service, images, repository"]
[menu.main]
parent="smn_registry"
weight=2
+++
<![end-metadata]-->
# Registry Configuration Reference # Registry Configuration Reference

View file

@ -1,8 +1,14 @@
<!--GITHUB <!--[metadata]>
page_title: Deploying a registry server +++
page_description: Explains how to deploy a registry server title = "Deploying a registry server"
page_keywords: registry, service, images, repository, deploy description = "Explains how to deploy a registry server"
IGNORES--> keywords = ["registry, service, images, repository"]
[menu.main]
parent="smn_registry"
weight=1
+++
<![end-metadata]-->
# Deploying a registry server # Deploying a registry server

View file

@ -1,17 +0,0 @@
# Project
## Contents
- [Docker Registry 2.0](index.md)
- [Architecture](architecture.md)
- [Build the development environment](building.md)
- [Configure a registry](configuration.md)
- [Deploying a registry server](deploying.md)
- [Microsoft Azure storage driver](storage-drivers/azure.md)
- [Filesystem storage driver](storage-drivers/filesystem.md)
- [In-memory storage driver](storage-drivers/inmemory.md)
- [S3 storage driver](storage-drivers/s3.md)
- [Notifications](notifications.md)
- [Docker Registry HTTP API V2](spec/api.md)
- [Docker Registry v2 authentication via central service](spec/auth/token.md)
- [Docker Distribution JSON Canonicalization](spec/json.md)
- [Docker-Registry Storage Driver](storagedrivers.md)

View file

@ -1,8 +1,8 @@
<!--GITHUB <!--[metadata]>
page_title: Distribution glossary +++
page_description: Provides definition for distribution terms draft = "true"
page_keywords: registry, service, images, repository, distribution, glossary, layer, blob +++
IGNORES--> <![end-metadata]-->
# Glossary # Glossary

View file

@ -1,3 +1,9 @@
<!--[metadata]>
+++
draft = "true"
+++
<![end-metadata]-->
# Migrating a 1.0 registry to 2.0 # Migrating a 1.0 registry to 2.0
TODO: This needs to be revised in light of Olivier's work TODO: This needs to be revised in light of Olivier's work

View file

@ -1,8 +1,14 @@
<!--GITHUB <!--[metadata]>
page_title: Work with Notifications +++
page_description: Explains how to deploy a registry server title = "Work with Notifications"
page_keywords: registry, service, images, repository description = "Explains work with registry notifications"
IGNORES--> keywords = ["registry, service, images, notifications, repository"]
[menu.main]
parent="smn_registry"
weight=1
+++
<![end-metadata]-->
# Notifications # Notifications

View file

@ -1,3 +1,9 @@
<!--[metadata]>
+++
draft = "true"
+++
<![end-metadata]-->
# OS X Setup Guide # OS X Setup Guide
This guide will walk you through running the new Go based [Docker registry](https://github.com/docker/distribution) on your local OS X machine. This guide will walk you through running the new Go based [Docker registry](https://github.com/docker/distribution) on your local OS X machine.

View file

@ -1,8 +1,13 @@
<!--GITHUB <!--[metadata]>
page_title: Docker Registry 2.0 +++
page_description: Introduces the Docker Registry title = "Docker Registry 2.0"
page_keywords: registry, images, repository description = "Introduces the Docker Registry"
IGNORES--> keywords = ["registry, images, repository"]
[menu.main]
parent="smn_registry"
+++
<![end-metadata]-->
# Docker Registry # Docker Registry

View file

@ -1,8 +1,14 @@
<!--GITHUB <!--[metadata]>
page_title: Docker Registry HTTP API V2 +++
page_description: Explains how to use registry API draft = true
page_keywords: registry, service, driver, images, storage, api title = "Docker Registry HTTP API V2"
IGNORES--> description = "This is a specification for the API."
keywords = ["registry, service, driver, images, storage, api"]
[menu.main]
parent="smn_registry_ref"
+++
<![end-metadata]-->
# Docker Registry HTTP API V2 # Docker Registry HTTP API V2

View file

@ -1,8 +1,13 @@
<!--GITHUB <!--[metadata]>
page_title: Docker Registry HTTP API V2 +++
page_description: Explains how to use registry API draft = true
page_keywords: registry, service, driver, images, storage, api title = "Docker Registry HTTP API V2"
IGNORES--> description = "This is a specification for the API."
keywords = ["registry, service, driver, images, storage, api"]
[menu.main]
parent="smn_registry_ref"
+++
<![end-metadata]-->
# Docker Registry HTTP API V2 # Docker Registry HTTP API V2

View file

@ -1,8 +1,13 @@
<!--GITHUB <!--[metadata]>
page_title: Docker Registry v2 Authentication +++
page_description: Introduces the Docker Registry v2 authentication title = "Docker Registry v2 Authentication"
page_keywords: registry, images, repository, v2, authentication description = "Introduces the Docker Registry v2 authentication"
IGNORES--> keywords = ["registry, images, repository, v2, authentication"]
[menu.main]
parent="smn_registry_ref"
+++
<![end-metadata]-->
# Docker Registry v2 authentication via central service # Docker Registry v2 authentication via central service

View file

@ -1,8 +1,13 @@
<!--GITHUB <!--[metadata]>
page_title: Docker Distribution JSON Canonicalization +++
page_description: Explains registry JSON objects title = "Docker Distribution JSON Canonicalization"
page_keywords: registry, service, images, repository, json description = "Explains registry JSON objects"
IGNORES--> keywords = ["registry, service, images, repository, json"]
[menu.main]
parent="smn_registry_ref"
+++
<![end-metadata]-->
# Docker Distribution JSON Canonicalization # Docker Distribution JSON Canonicalization

View file

@ -1,8 +1,13 @@
<!--GITHUB <!--[metadata]>
page_title: Microsoft Azure storage driver +++
page_description: Explains how to use the Azure storage drivers title = "Microsoft Azure storage driver"
page_keywords: registry, service, driver, images, storage, azure description = "Explains how to use the Azure storage drivers"
IGNORES--> keywords = ["registry, service, driver, images, storage, azure"]
[menu.main]
parent="smn_registry_drivers"
+++
<![end-metadata]-->
# Microsoft Azure storage driver # Microsoft Azure storage driver

View file

@ -1,8 +1,13 @@
<!--GITHUB <!--[metadata]>
page_title: Filesystem storage driver +++
page_description: Explains how to use the filesystem storage drivers title = "Filesystem storage driver"
page_keywords: registry, service, driver, images, storage, filesystem description = "Explains how to use the filesystem storage drivers"
IGNORES--> keywords = ["registry, service, driver, images, storage, filesystem"]
[menu.main]
parent="smn_registry_drivers"
+++
<![end-metadata]-->
# Filesystem storage driver # Filesystem storage driver

View file

@ -1,8 +1,13 @@
<!--GITHUB <!--[metadata]>
page_title: In-memory storage driver +++
page_description: Explains how to use the in-memory storage drivers title = "In-memory storage driver"
page_keywords: registry, service, driver, images, storage, in-memory description = "Explains how to use the in-memory storage drivers"
IGNORES--> keywords = ["registry, service, driver, images, storage, in-memory"]
[menu.main]
parent="smn_registry_drivers"
+++
<![end-metadata]-->
# In-memory storage driver # In-memory storage driver

View file

@ -1,8 +1,13 @@
<!--GITHUB <!--[metadata]>
page_title: Ceph RADOS storage driver +++
page_description: Explains how to use the Ceph RADOS storage driver title = "Ceph RADOS storage driver"
page_keywords: registry, service, driver, images, storage, ceph, rados description = "Explains how to use the Ceph RADOS storage driver"
IGNORES--> keywords = ["registry, service, driver, images, storage, ceph, rados"]
[menu.main]
parent="smn_registry_drivers"
+++
<![end-metadata]-->
# Ceph RADOS storage driver # Ceph RADOS storage driver

View file

@ -1,8 +1,13 @@
<!--GITHUB <!--[metadata]>
page_title: S3 storage driver +++
page_description: Explains how to use the S3 storage drivers title = "S3 storage driver"
page_keywords: registry, service, driver, images, storage, S3 description = "Explains how to use the S3 storage drivers"
IGNORES--> keywords = ["registry, service, driver, images, storage, S3"]
[menu.main]
parent="smn_registry_drivers"
+++
<![end-metadata]-->
# S3 storage driver # S3 storage driver

View file

@ -1,8 +1,14 @@
<!--GITHUB <!--[metadata]>
page_title: Docker Registry Storage Driver +++
page_description: Explains how to use the storage drivers title = "Docker Registry Storage Driver"
page_keywords: registry, service, driver, images, storage description = "Explains how to use the storage drivers"
IGNORES--> keywords = ["registry, service, driver, images, storage"]
[menu.main]
parent="smn_registry_ref"
identifier="smn_registry_drivers"
+++
<![end-metadata]-->
# Docker Registry Storage Driver # Docker Registry Storage Driver