Skip to content

Commit

Permalink
make the non-release doc warning conditional and add version info
Browse files Browse the repository at this point in the history
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 moby#5272

Docker-DCO-1.1-Signed-off-by: Sven Dowideit <[email protected]> (github: SvenDowideit)
  • Loading branch information
SvenDowideit committed Apr 23, 2014
1 parent 9d38fd0 commit dc982d3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ build: bundles
docker build -t "$(DOCKER_IMAGE)" .

docs-build:
cp ./VERSION docs/VERSION
echo "$(GIT_BRANCH)" > docs/GIT_BRANCH
echo "$(AWS_S3_BUCKET)" > docs/AWS_S3_BUCKET
docker build -t "$(DOCKER_DOCS_IMAGE)" docs

bundles:
Expand Down
5 changes: 5 additions & 0 deletions docs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ WORKDIR /docs
#convert to markdown
#RUN ./convert.sh

RUN VERSION=$(cat /docs/VERSION) &&\
GIT_BRANCH=$(cat /docs/GIT_BRANCH) &&\
AWS_S3_BUCKET=$(cat /docs/AWS_S3_BUCKET) &&\
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

# note, EXPOSE is only last because of https://github.com/dotcloud/docker/issues/3525
EXPOSE 8000

Expand Down
2 changes: 1 addition & 1 deletion docs/theme/mkdocs/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<div class="col-sm-8" role="main">
{% include "breadcrumbs.html" %}
<main id="content" role="main">
{% include "beta_warning.html" %}
{% include "version.html" %}
{{ content }}
</main>
</div>
Expand Down
9 changes: 7 additions & 2 deletions docs/theme/mkdocs/beta_warning.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% if aws_bucket != "docs.docker.io" %}
<style>
.bs-callout {
padding: 20px;
Expand All @@ -22,6 +23,10 @@
}
</style>
<div class="bs-callout bs-callout-danger">
<h4>You are looking at the <span>beta</span> docs for the development version of Docker.</h4>
There is a chance of them being different from the prior versions.
<h4>This is the
<span>{% if docker_version != docker_version|replace("-dev", "bingo") %}{{ docker_branch }} development branch{% else %}beta{% endif %}</span>
documentation for Docker version {{ docker_version }}.</h4>
Please go to <a href="http://docs.docker.io">http://docs.docker.io</a> for the current Docker release documentation.
{{ aws_bucket }}
</div>
{% endif %}

0 comments on commit dc982d3

Please sign in to comment.