mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Give the Redirect a HostName - filled in from the s3 bucket name.
Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@fosiki.com> (github: SvenDowideit)
This commit is contained in:
parent
5877ae2462
commit
0d59cc080a
3 changed files with 12 additions and 9 deletions
|
@ -4,7 +4,7 @@
|
|||
FROM debian:jessie
|
||||
MAINTAINER Sven Dowideit <SvenDowideit@docker.com> (@SvenDowideit)
|
||||
|
||||
RUN apt-get update && apt-get install -yq make python-pip python-setuptools vim-tiny git pandoc
|
||||
RUN apt-get update && apt-get install -yq make python-pip python-setuptools vim-tiny git gettext
|
||||
|
||||
RUN pip install mkdocs
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ EOF
|
|||
[ "$AWS_S3_BUCKET" ] || usage
|
||||
|
||||
#VERSION=$(cat VERSION)
|
||||
BUCKET=$AWS_S3_BUCKET
|
||||
export BUCKET=$AWS_S3_BUCKET
|
||||
|
||||
export AWS_CONFIG_FILE=$(pwd)/awsconfig
|
||||
[ -e "$AWS_CONFIG_FILE" ] || usage
|
||||
|
@ -37,7 +37,10 @@ setup_s3() {
|
|||
# Make the bucket accessible through website endpoints.
|
||||
echo "make $BUCKET accessible as a website"
|
||||
#aws s3 website s3://$BUCKET --index-document index.html --error-document jsearch/index.html
|
||||
s3conf=$(cat s3_website.json)
|
||||
s3conf=$(cat s3_website.json | envsubst)
|
||||
echo
|
||||
echo $s3conf
|
||||
echo
|
||||
aws s3api put-bucket-website --bucket $BUCKET --website-configuration "$s3conf"
|
||||
}
|
||||
|
||||
|
|
|
@ -6,12 +6,12 @@
|
|||
"Suffix": "index.html"
|
||||
},
|
||||
"RoutingRules": [
|
||||
{ "Condition": { "KeyPrefixEquals": "en/latest/" }, "Redirect": { "ReplaceKeyPrefixWith": "" } },
|
||||
{ "Condition": { "KeyPrefixEquals": "en/master/" }, "Redirect": { "ReplaceKeyPrefixWith": "" } },
|
||||
{ "Condition": { "KeyPrefixEquals": "en/v0.6.3/" }, "Redirect": { "ReplaceKeyPrefixWith": "" } },
|
||||
{ "Condition": { "KeyPrefixEquals": "jsearch/index.html" }, "Redirect": { "ReplaceKeyPrefixWith": "jsearch/" } },
|
||||
{ "Condition": { "KeyPrefixEquals": "index/" }, "Redirect": { "ReplaceKeyPrefixWith": "docker-io/" } },
|
||||
{ "Condition": { "KeyPrefixEquals": "reference/api/index_api/" }, "Redirect": { "ReplaceKeyPrefixWith": "reference/api/docker-io_api/" } }
|
||||
{ "Condition": { "KeyPrefixEquals": "en/latest/" }, "Redirect": { "HostName": "$BUCKET", "ReplaceKeyPrefixWith": "" } },
|
||||
{ "Condition": { "KeyPrefixEquals": "en/master/" }, "Redirect": { "HostName": "$BUCKET", "ReplaceKeyPrefixWith": "" } },
|
||||
{ "Condition": { "KeyPrefixEquals": "en/v0.6.3/" }, "Redirect": { "HostName": "$BUCKET", "ReplaceKeyPrefixWith": "" } },
|
||||
{ "Condition": { "KeyPrefixEquals": "jsearch/index.html" }, "Redirect": { "HostName": "$BUCKET", "ReplaceKeyPrefixWith": "jsearch/" } },
|
||||
{ "Condition": { "KeyPrefixEquals": "index/" }, "Redirect": { "HostName": "$BUCKET", "ReplaceKeyPrefixWith": "docker-io/" } },
|
||||
{ "Condition": { "KeyPrefixEquals": "reference/api/index_api/" }, "Redirect": { "HostName": "$BUCKET", "ReplaceKeyPrefixWith": "reference/api/docker-io_api/" } }
|
||||
]
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue