Skip to content

Commit

Permalink
avoid publishing to the root unless specified, so old version release…
Browse files Browse the repository at this point in the history
…s only goto their own dir

Docker-DCO-1.1-Signed-off-by: SvenDowideit <[email protected]> (github: SvenDowideit)
  • Loading branch information
SvenDowideit committed Jul 22, 2014
1 parent 3472c00 commit 4d109f6
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions docs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 8 additions & 2 deletions docs/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
3 changes: 2 additions & 1 deletion docs/theme/mkdocs/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
{% 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" %}
<meta name="docker_version" content="{{ docker_version }}">
<meta name="docker_git_branch" content="{{ docker_branch }}">
<meta name="docker_git_commit" content="{{ docker_commit }}">
<meta name="docker_build_date" content="{{ build_date }}">

{% if meta.page_description %}<meta name="description" content="{{ meta.page_description[0] }}">{% endif %}
{% if meta.page_keywords %}<meta name="keywords" content="{{ meta.page_keywords[0] }}">{% endif %}
Expand Down
4 changes: 2 additions & 2 deletions hack/RELEASE-CHECKLIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4d109f6

Please sign in to comment.