From 4d109f6158c7607ee4cd9907b17ddba5f4d29d04 Mon Sep 17 00:00:00 2001 From: SvenDowideit Date: Tue, 22 Jul 2014 19:05:18 +1000 Subject: [PATCH] avoid publishing to the root unless specified, so old version releases only goto their own dir Docker-DCO-1.1-Signed-off-by: SvenDowideit (github: SvenDowideit) --- Makefile | 2 +- docs/Dockerfile | 2 ++ docs/release.sh | 10 ++++++++-- docs/theme/mkdocs/base.html | 3 ++- hack/RELEASE-CHECKLIST.md | 4 ++-- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 444ac3c6a6c8a..71a3f32ec60a9 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 e1f6c5b548381..345de92bd0783 100644 --- a/docs/Dockerfile +++ b/docs/Dockerfile @@ -35,10 +35,12 @@ RUN VERSION=$(cat /docs/VERSION) &&\ 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 de54eb3f5f661..ba309aaea9b91 100755 --- a/docs/release.sh +++ b/docs/release.sh @@ -106,10 +106,16 @@ upload_current_documentation() { } setup_s3 -build_current_documentation -upload_current_documentation + +# 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 6505e26fcd0c1..2b2b9bcbcf6bf 100644 --- a/docs/theme/mkdocs/base.html +++ b/docs/theme/mkdocs/base.html @@ -4,10 +4,11 @@ - {% 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 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 %} diff --git a/hack/RELEASE-CHECKLIST.md b/hack/RELEASE-CHECKLIST.md index 2209baa74501e..ccdcaee0205cd 100644 --- a/hack/RELEASE-CHECKLIST.md +++ b/hack/RELEASE-CHECKLIST.md @@ -146,7 +146,7 @@ To make a shared test at http://beta-docs.docker.io: (You will need the `awsconfig` file added to the `docs/` dir) ```bash -make AWS_S3_BUCKET=beta-docs.docker.io docs-release +make AWS_S3_BUCKET=beta-docs.docker.io BUILD_ROOT=yes docs-release ``` ### 5. Commit and create a pull request to the "release" branch @@ -267,7 +267,7 @@ git checkout -b docs release || git checkout docs git fetch git reset --hard origin/release git push -f origin docs -make AWS_S3_BUCKET=docs.docker.com docs-release +make AWS_S3_BUCKET=docs.docker.com BUILD_ROOT=yes docs-release ``` The docs will appear on http://docs.docker.com/ (though there may be cached