diff --git a/Makefile b/Makefile
index 444ac3c6a6..71a3f32ec6 100644
--- a/Makefile
+++ b/Makefile
@@ -34,7 +34,7 @@ docs-shell: docs-build
$(DOCKER_RUN_DOCS) -p $(if $(DOCSPORT),$(DOCSPORT):)8000 "$(DOCKER_DOCS_IMAGE)" bash
docs-release: docs-build
- $(DOCKER_RUN_DOCS) "$(DOCKER_DOCS_IMAGE)" ./release.sh
+ $(DOCKER_RUN_DOCS) -e BUILD_ROOT "$(DOCKER_DOCS_IMAGE)" ./release.sh
test: build
$(DOCKER_RUN_DOCKER) hack/make.sh binary cross test-unit test-integration test-integration-cli
diff --git a/docs/Dockerfile b/docs/Dockerfile
index 329646ed01..345de92bd0 100644
--- a/docs/Dockerfile
+++ b/docs/Dockerfile
@@ -16,6 +16,9 @@ RUN pip install mkdocs
# this version works, the current versions fail in different ways
RUN pip install awscli==1.3.9
+# make sure the git clone is not an old cache - we've published old versions a few times now
+ENV CACHE_BUST Jul2014
+
# get my sitemap.xml branch of mkdocs and use that for now
RUN git clone https://github.com/SvenDowideit/mkdocs &&\
cd mkdocs/ &&\
@@ -27,12 +30,17 @@ ADD MAINTAINERS /docs/sources/humans.txt
WORKDIR /docs
RUN VERSION=$(cat /docs/VERSION) &&\
+ MAJOR_MINOR="${VERSION%.*}" &&\
+ for i in $(seq $MAJOR_MINOR -0.1 1.0) ; do echo "
Version v$i" ; done > /docs/sources/versions.html_fragment &&\
GIT_BRANCH=$(cat /docs/GIT_BRANCH) &&\
GITCOMMIT=$(cat /docs/GITCOMMIT) &&\
AWS_S3_BUCKET=$(cat /docs/AWS_S3_BUCKET) &&\
+ BUILD_DATE=$(date) &&\
sed -i "s/\$VERSION/$VERSION/g" /docs/theme/mkdocs/base.html &&\
+ sed -i "s/\$MAJOR_MINOR/v$MAJOR_MINOR/g" /docs/theme/mkdocs/base.html &&\
sed -i "s/\$GITCOMMIT/$GITCOMMIT/g" /docs/theme/mkdocs/base.html &&\
sed -i "s/\$GIT_BRANCH/$GIT_BRANCH/g" /docs/theme/mkdocs/base.html &&\
+ sed -i "s/\$BUILD_DATE/$BUILD_DATE/g" /docs/theme/mkdocs/base.html &&\
sed -i "s/\$AWS_S3_BUCKET/$AWS_S3_BUCKET/g" /docs/theme/mkdocs/base.html
# note, EXPOSE is only last because of https://github.com/dotcloud/docker/issues/3525
diff --git a/docs/release.sh b/docs/release.sh
index f6dc2ec59f..ba309aaea9 100755
--- a/docs/release.sh
+++ b/docs/release.sh
@@ -27,6 +27,10 @@ if [ "$$AWS_S3_BUCKET" == "docs.docker.com" ]; then
fi
fi
+# Remove the last version - 1.0.2-dev -> 1.0
+MAJOR_MINOR="v${VERSION%.*}"
+export MAJOR_MINOR
+
export BUCKET=$AWS_S3_BUCKET
export AWS_CONFIG_FILE=$(pwd)/awsconfig
@@ -69,7 +73,8 @@ upload_current_documentation() {
# a really complicated way to send only the files we want
# if there are too many in any one set, aws s3 sync seems to fall over with 2 files to go
- endings=( json html xml css js gif png JPG ttf svg woff)
+ # versions.html_fragment
+ endings=( json html xml css js gif png JPG ttf svg woff html_fragment )
for i in ${endings[@]}; do
include=""
for j in ${endings[@]}; do
@@ -101,13 +106,16 @@ upload_current_documentation() {
}
setup_s3
-build_current_documentation
-upload_current_documentation
-# Remove the last version - 1.0.2-dev -> 1.0
-MAJOR_MINOR="v${VERSION%.*}"
+# Default to only building the version specific docs so we don't clober the latest by accident with old versions
+if [ "$BUILD_ROOT" == "yes" ]; then
+ echo "Building root documentation"
+ build_current_documentation
+ upload_current_documentation
+fi
#build again with /v1.0/ prefix
sed -i "s/^site_url:.*/site_url: \/$MAJOR_MINOR\//" mkdocs.yml
+echo "Building the /$MAJOR_MINOR/ documentation"
build_current_documentation
upload_current_documentation "/$MAJOR_MINOR/"
diff --git a/docs/theme/mkdocs/base.html b/docs/theme/mkdocs/base.html
index 8f2bd0603a..2b2b9bcbcf 100644
--- a/docs/theme/mkdocs/base.html
+++ b/docs/theme/mkdocs/base.html
@@ -4,10 +4,11 @@
-{% set docker_version = "$VERSION" %}{% set docker_commit = "$GITCOMMIT" %}{% set docker_branch = "$GIT_BRANCH" %}{% set aws_bucket = "$AWS_S3_BUCKET" %}
+ {% set docker_version = "$VERSION" %}{% set major_minor = "$MAJOR_MINOR" %}{% set docker_commit = "$GITCOMMIT" %}{% set docker_branch = "$GIT_BRANCH" %}{% set aws_bucket = "$AWS_S3_BUCKET" %}{% set build_date = "$BUILD_DATE" %}
+
{% if meta.page_description %}{% endif %}
{% if meta.page_keywords %}{% endif %}
@@ -48,11 +49,23 @@
{% if current_page.title != '**HIDDEN**' %}