-
Notifications
You must be signed in to change notification settings - Fork 7.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: Add GitHub action to upload S3 website configuration #10612
Conversation
Signed-off-by: Stefan Scherer <stefan.scherer@docker.com>
126c92b
to
57dcafe
Compare
A temporary build that also ran in this PR branch was green: https://github.com/docker/docker.github.io/pull/10612/checks?check_run_id=573354449 and it successfully uploaded the website config for docs-stage. |
Ping @thaJeztah this is the replacement for the nginx redirect rules we had in the past. Now a similar config for S3 website is back in the repo to maintain it through PRs. |
Thanks! I just recalled we also need to take echo "{" > extra-redirects.json
grep -E ': "/(compliance|datacenter|ee)/' <(curl -fsSL https://docs.docker.com/redirects.json | jq .) >> extra-redirects.json
echo ' "/dummy/": "/"' >> extra-redirects.json
echo "}" >> extra-redirects.json |
For those pages, I think we'd need dummy pages in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR only adds automation to the current status. I've uploaded the website configs manually with a similar Go tool, there's no aws cli command for that. For the three EE related folders I plan to do this in a new PR after the merge. We can simply remove the three folders and add three redirection rules to the new website*.json files. We will test this PR in docs-stage to see if everything gets a new URL prefix with the target domain name. |
Right, so that's the tricky bit; there's redirects that are currently in place that redirect to the For example, https://docs.docker.com/reference/ucp/3.0/cli/support/ redirects to https://docs.docker.com/datacenter/ucp/3.0/reference/cli/support/ That redirect is defined in https://github.com/docker/docker.github.io/blame/663ea14a3ca321d8f4a257d3b5ca8648ba5aec2d/datacenter/ucp/3.0/reference/cli/support.md#L6 Which means that once that page is removed, the redirect is no longer in place. So for pages that define a redirect, we should either replace them with a "dummy" page that only has the |
Updated, with redirect "from" |
I don't know how much effort we want to put into the forwarding to Mirantis. Do we have an "SLA" of how many of the old links should work/redirect to them? 😅 |
Add a GitHub action to upload the S3 website configuration from a JSON file in this repo.
With that PR it's possible to maintain the redirections directly from this repo by making pull requests to
_website-config-docs-stage.json
for https://docs-stage.docker.com_website-config-docs.json
for https://docs.docker.comAn example for the docs-stage.docker.com site with a redirect of all
v17.03/
to/
Important keys are
KeyPrefixEquals
is set tov17.03/
ReplaceKeyPrefixWith
is set to empty string""
which means/
HostName
andProtocol
must be set for each redirect rule, otherwise AWS redirects to the internal name. That's why we need two different JSON files.