Browse code

avoid publishing to the root unless specified, so old version releases only goto their own dir

Docker-DCO-1.1-Signed-off-by: SvenDowideit <SvenDowideit@home.org.au> (github: SvenDowideit)

SvenDowideit authored on 2014/07/22 18:05:18
Showing 5 changed files
... ...
@@ -34,7 +34,7 @@ docs-shell: docs-build
34 34
 	$(DOCKER_RUN_DOCS) -p $(if $(DOCSPORT),$(DOCSPORT):)8000 "$(DOCKER_DOCS_IMAGE)" bash
35 35
 
36 36
 docs-release: docs-build
37
-	$(DOCKER_RUN_DOCS) "$(DOCKER_DOCS_IMAGE)" ./release.sh
37
+	$(DOCKER_RUN_DOCS) -e BUILD_ROOT "$(DOCKER_DOCS_IMAGE)" ./release.sh
38 38
 
39 39
 test: build
40 40
 	$(DOCKER_RUN_DOCKER) hack/make.sh binary cross test-unit test-integration test-integration-cli
... ...
@@ -35,10 +35,12 @@ RUN	VERSION=$(cat /docs/VERSION)								&&\
35 35
 	GIT_BRANCH=$(cat /docs/GIT_BRANCH)							&&\
36 36
 	GITCOMMIT=$(cat /docs/GITCOMMIT)							&&\
37 37
 	AWS_S3_BUCKET=$(cat /docs/AWS_S3_BUCKET)						&&\
38
+	BUILD_DATE=$(date)									&&\
38 39
 	sed -i "s/\$VERSION/$VERSION/g" /docs/theme/mkdocs/base.html				&&\
39 40
 	sed -i "s/\$MAJOR_MINOR/v$MAJOR_MINOR/g" /docs/theme/mkdocs/base.html			&&\
40 41
 	sed -i "s/\$GITCOMMIT/$GITCOMMIT/g" /docs/theme/mkdocs/base.html			&&\
41 42
 	sed -i "s/\$GIT_BRANCH/$GIT_BRANCH/g" /docs/theme/mkdocs/base.html			&&\
43
+	sed -i "s/\$BUILD_DATE/$BUILD_DATE/g" /docs/theme/mkdocs/base.html				&&\
42 44
 	sed -i "s/\$AWS_S3_BUCKET/$AWS_S3_BUCKET/g" /docs/theme/mkdocs/base.html
43 45
 
44 46
 # note, EXPOSE is only last because of https://github.com/dotcloud/docker/issues/3525
... ...
@@ -106,10 +106,16 @@ upload_current_documentation() {
106 106
 }
107 107
 
108 108
 setup_s3
109
-build_current_documentation
110
-upload_current_documentation
109
+
110
+# Default to only building the version specific docs so we don't clober the latest by accident with old versions
111
+if [ "$BUILD_ROOT" == "yes" ]; then
112
+	echo "Building root documentation"
113
+	build_current_documentation
114
+	upload_current_documentation
115
+fi
111 116
 
112 117
 #build again with /v1.0/ prefix
113 118
 sed -i "s/^site_url:.*/site_url: \/$MAJOR_MINOR\//" mkdocs.yml
119
+echo "Building the /$MAJOR_MINOR/ documentation"
114 120
 build_current_documentation
115 121
 upload_current_documentation "/$MAJOR_MINOR/"
... ...
@@ -4,10 +4,11 @@
4 4
   <meta charset="utf-8">
5 5
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
6 6
   <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
7
-  {% set docker_version = "$VERSION" %}{% set major_minor = "$MAJOR_MINOR" %}{% set docker_commit = "$GITCOMMIT" %}{% set docker_branch = "$GIT_BRANCH" %}{% set aws_bucket = "$AWS_S3_BUCKET" %}
7
+  {% 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" %}
8 8
   <meta name="docker_version" content="{{ docker_version }}">
9 9
   <meta name="docker_git_branch" content="{{ docker_branch }}">
10 10
   <meta name="docker_git_commit" content="{{ docker_commit }}">
11
+  <meta name="docker_build_date" content="{{ build_date }}">
11 12
 
12 13
   {% if meta.page_description %}<meta name="description" content="{{ meta.page_description[0] }}">{% endif %}
13 14
   {% if meta.page_keywords %}<meta name="keywords" content="{{ meta.page_keywords[0] }}">{% endif %}
... ...
@@ -146,7 +146,7 @@ To make a shared test at http://beta-docs.docker.io:
146 146
 (You will need the `awsconfig` file added to the `docs/` dir)
147 147
 
148 148
 ```bash
149
-make AWS_S3_BUCKET=beta-docs.docker.io docs-release
149
+make AWS_S3_BUCKET=beta-docs.docker.io BUILD_ROOT=yes docs-release
150 150
 ```
151 151
 
152 152
 ### 5. Commit and create a pull request to the "release" branch
... ...
@@ -267,7 +267,7 @@ git checkout -b docs release || git checkout docs
267 267
 git fetch
268 268
 git reset --hard origin/release
269 269
 git push -f origin docs
270
-make AWS_S3_BUCKET=docs.docker.com docs-release
270
+make AWS_S3_BUCKET=docs.docker.com BUILD_ROOT=yes docs-release
271 271
 ```
272 272
 
273 273
 The docs will appear on http://docs.docker.com/ (though there may be cached