Browse code

make the non-release doc warning conditional and add version info

use the beta-warning area to tell the user what VERSION of docker, git
branch, and links to the official release version docs are.

requires / extends PR #5272

Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@fosiki.com> (github: SvenDowideit)

Sven Dowideit authored on 2014/04/23 15:28:06
Showing 4 changed files
... ...
@@ -53,6 +53,9 @@ build: bundles
53 53
 	docker build -t "$(DOCKER_IMAGE)" .
54 54
 
55 55
 docs-build:
56
+	cp ./VERSION docs/VERSION
57
+	echo "$(GIT_BRANCH)" > docs/GIT_BRANCH
58
+	echo "$(AWS_S3_BUCKET)" > docs/AWS_S3_BUCKET
56 59
 	docker build -t "$(DOCKER_DOCS_IMAGE)" docs
57 60
 
58 61
 bundles:
... ...
@@ -39,6 +39,11 @@ WORKDIR	/docs
39 39
 #convert to markdown
40 40
 #RUN	./convert.sh
41 41
 
42
+RUN	VERSION=$(cat /docs/VERSION)								&&\
43
+	GIT_BRANCH=$(cat /docs/GIT_BRANCH)							&&\
44
+	AWS_S3_BUCKET=$(cat /docs/AWS_S3_BUCKET)						&&\
45
+	echo "{% set docker_version = \"${VERSION}\" %}{% set docker_branch = \"${GIT_BRANCH}\" %}{% set aws_bucket = \"${AWS_S3_BUCKET}\" %}{% include \"beta_warning.html\" %}" > /docs/theme/mkdocs/version.html
46
+
42 47
 # note, EXPOSE is only last because of https://github.com/dotcloud/docker/issues/3525
43 48
 EXPOSE	8000
44 49
 
... ...
@@ -48,7 +48,7 @@
48 48
             <div class="col-sm-8" role="main">
49 49
               {% include "breadcrumbs.html" %}
50 50
               <main id="content" role="main">
51
-                {% include "beta_warning.html" %}
51
+		{% include "version.html" %}
52 52
                 {{ content }}
53 53
               </main>
54 54
             </div>
... ...
@@ -1,3 +1,4 @@
1
+{% if aws_bucket != "docs.docker.io" %}
1 2
 <style>
2 3
 .bs-callout {
3 4
   padding: 20px;
... ...
@@ -22,6 +23,10 @@
22 22
 }
23 23
 </style>
24 24
 <div class="bs-callout bs-callout-danger">
25
-<h4>You are looking at the <span>beta</span> docs for the development version of Docker.</h4>
26
-There is a chance of them being different from the prior versions.
25
+	<h4>This is the
26
+		<span>{% if docker_version != docker_version|replace("-dev", "bingo") %}{{ docker_branch }} development branch{% else %}beta{% endif %}</span>
27
+		documentation for Docker version {{ docker_version }}.</h4>
28
+	Please go to <a href="http://docs.docker.io">http://docs.docker.io</a> for the current Docker release documentation.
29
+	{{ aws_bucket }}
27 30
 </div>
31
+{% endif %}