-
Notifications
You must be signed in to change notification settings - Fork 139
RDoc-3361 Added deployment script #2068
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
Conversation
scripts/deploy.ps1
Outdated
[CmdletBinding()] | ||
param( | ||
[Parameter(Mandatory=$true)] | ||
[string]$AwsRegion, |
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.
region is going to come from AWS_DEFAULT_REGION env var
scripts/deploy.ps1
Outdated
# 1. Gather AWS credentials from environment | ||
# --------------------------------------------------------------------------- | ||
$EnvCreds = @{ | ||
AccessKey = $Env:AWS_ACCESS_KEY_ID | ||
Secret = $Env:AWS_SECRET_ACCESS_KEY | ||
Session = $Env:AWS_SESSION_TOKEN | ||
} | ||
ThrowIfEmpty $EnvCreds.AccessKey "AWS_ACCESS_KEY_ID environment variable not set" | ||
ThrowIfEmpty $EnvCreds.Secret "AWS_SECRET_ACCESS_KEY environment variable not set" | ||
|
||
# export region for downstream CLI calls | ||
$Env:AWS_REGION = $AwsRegion | ||
|
||
Write-Host "Using AWS region $AwsRegion and bucket $S3BucketName" -ForegroundColor Cyan | ||
|
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.
we just need to check if they are there, no need to load it into any var like EnvCreds - aws CLI will manage
scripts/deploy.ps1
Outdated
# Ensure Docusaurus CLI is available | ||
if (-not (Get-Command docusaurus -ErrorAction SilentlyContinue)) { | ||
Write-Host "Docusaurus CLI not found – installing locally (no-save)..." -ForegroundColor Yellow | ||
npm install --no-save @docusaurus/core@latest @docusaurus/cli@latest | Out-Null |
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.
can we use npm ci?
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.
npm ci
static/robots.txt
Outdated
Disallow: /test/ | ||
Disallow: /wip/ | ||
|
||
# AI crawlers you want to exclude |
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.
actually we want to allow AI training on these docs. Change to allow for all agents not only GPTBot
static/robots.txt
Outdated
User-agent: * | ||
Allow: / | ||
|
||
# Block duplicate or low-value paths |
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.
we don't have such paths - no need for that
@@ -0,0 +1,17 @@ | |||
# robots.txt for RavenDB Documentation | |||
User-agent: * |
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.
I think we could just allow to any agent - AI, robots, etc.. Ensure it's not risky.
This way we could have
allow-all
sitemap
and it's done
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.
robots.txt is only for "nice" robots looking at signs on the road, note
|
||
def mdx_block(entry: Dict[str, Any]) -> str: | ||
"""Full MDX chunk for a single changelog entry (heading + body).""" | ||
return mdx_heading(entry) + convert_html_to_markdown(entry["changelogHtml"]) |
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.
We can talk with the API team to add us source markdown field, which won't feel then like getting strawberries out of a milkshake. cc @lukaszdobrzynski
However we can go live with this, not a blocker.
# --------------------------------------------------------------------------- | ||
if ($CloudFrontDistributionId) { | ||
Write-Host "Invalidating CloudFront distribution $CloudFrontDistributionId" -ForegroundColor Cyan | ||
aws cloudfront create-invalidation --distribution-id $CloudFrontDistributionId --paths '/*' | Out-Null |
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.
later on if we know what version changed we could us that knowledge to invalidate proper path
response = requests.get( | ||
API_BASE_URL, | ||
headers={ | ||
"Authorization": f"Bearer {API_KEY}", |
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.
Well, you won't be able to do it like this I'm afraid. This token I supplied you with is short-lived and to get a new one, you'd need some more details and ceremony. To get it going let's download these items, make what's new files and push it to the repo for the time being.
This one is a no-go in the current shape.
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.
Actually, we can make it work. @poissoncorp Please arrange a short one with @lukaszdobrzynski - we'd need a new secret.
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.
what's new script won't do
// Remove this to remove the "edit this page" links. | ||
// editUrl: | ||
// 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/', | ||
// 'https://github.com/ravendb/docs/new-docs/main/' |
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.
remember to change it while deploying @Lwiel
No description provided.