Updating for Hugo

Updating for tooling tests
Updating with the new sed scripts to protect links
updating with new image
Updating with comments

Signed-off-by: Mary Anthony <mary@docker.com>
This commit is contained in:
Mary Anthony 2015-06-07 17:58:53 -07:00
parent e57e731821
commit 832cb9d52c
23 changed files with 249 additions and 140 deletions

View file

@ -1,37 +1,24 @@
FROM docs/base:latest
MAINTAINER Mary <mary@docker.com> (@moxiegirl)
FROM docs/base:hugo
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
# Reset the /docs dir so we can replace the theme meta with the new repo's git info
RUN git reset --hard
COPY . /docs/content/distribution/
RUN grep "VERSION =" /src/version/version.go | sed 's/.*"\(.*\)".*/\1/' > /docs/VERSION
#
# 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/
COPY docs/images/* /docs/sources/registry/images/
COPY docs/spec/* /docs/sources/registry/spec/
COPY docs/spec/auth/* /docs/sources/registry/spec/auth/
COPY docs/storage-drivers/* /docs/sources/registry/storage-drivers/
COPY docs/mkdocs.yml /docs/mkdocs-distribution.yml
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
# 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 find /docs/content/distribution -type f -name "*.md" -exec sed -i.old \
-e '/^<!.*metadata]>/g' \
-e '/^<!.*end-metadata.*>/g' \
-e 's/\([(]\)\(.*\)\(\.md\)/\1\2/g' \
-e 's/\(\]\)\([(]\)\(\/\)/\1\2\/distribution\//g' \
-e 's/\(\][(]\)\([A-z]*[)]\)/\]\(\/distribution\/\2/g' \
-e 's/\(\][(]\)\(\.\.\/\)/\1\/distribution\//g' {} \;