Skip to content

Commit

Permalink
add ./script/doc to build swarm documentation using the docs.docker.c…
Browse files Browse the repository at this point in the history
…om tooling

Signed-off-by: Sven Dowideit <[email protected]>
  • Loading branch information
SvenDowideit committed Feb 24, 2015
1 parent 2f23f98 commit 11b2121
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
21 changes: 21 additions & 0 deletions docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM docs/base:latest
MAINTAINER Sven Dowideit <[email protected]> (@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/version.go | sed 's/.*"\(.*\)".*/\1/' > /docs/VERSION
COPY docs/mkdocs.yml /docs/mkdocs-swarm.yml

COPY ./scheduler/strategy/README.md /docs/sources/swarm/scheduler/strategy.md
COPY ./scheduler/filter/README.md /docs/sources/swarm/scheduler/filter.md
COPY ./api/README.md /docs/sources/swarm/API.md
COPY ./discovery/README.md /docs/sources/swarm/discovery.md
#COPY ./discovery/token/README.md /docs/sources/
COPY ./docs/index.md /docs/sources/swarm/index.md

# Then build everything together, ready for mkdocs
RUN /docs/build.sh
11 changes: 11 additions & 0 deletions docs/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
set -ex

# import the existing docs build cmds from docker/docker
DOCSPORT=8000
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
DOCKER_DOCS_IMAGE="compose-docs$GIT_BRANCH"
DOCKER_RUN_DOCS="docker run --rm -it -e NOCACHE"

docker build -t "$DOCKER_DOCS_IMAGE" -f docs/Dockerfile .
$DOCKER_RUN_DOCS -p $DOCSPORT:8000 "$DOCKER_DOCS_IMAGE" mkdocs serve
4 changes: 2 additions & 2 deletions userguide.md → docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ the certificates.
## Discovery services

See the [Discovery service](../discovery) document for more information.
See the [Discovery service](discovery.md) document for more information.

## Advanced Scheduling

See [filters](../scheduler/filter) and [strategies](../scheduler/strategy) to learn
See [filters](scheduler/filter.md) and [strategies](scheduler/strategy.md) to learn
more about advanced scheduling.
6 changes: 6 additions & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

- ['swarm/index.md', 'User Guide', 'Docker Swarm' ]
- ['swarm/discovery.md', 'Reference', 'Swarm discovery']
- ['swarm/API.md', 'Reference', 'Swarm API']
- ['swarm/scheduler/filter.md', 'Reference', 'Swarm filters']
- ['swarm/scheduler/strategy.md', 'Reference', 'Swarm strategies']

0 comments on commit 11b2121

Please sign in to comment.