Skip to content

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

Merged
merged 5 commits into from
Aug 4, 2025
Merged

Conversation

Lwiel
Copy link

@Lwiel Lwiel commented Aug 1, 2025

No description provided.

[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]$AwsRegion,
Copy link
Member

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

Comment on lines 94 to 108
# 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

Copy link
Member

@gregolsky gregolsky Aug 1, 2025

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

# 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
Copy link
Member

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?

Copy link
Member

@gregolsky gregolsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm ci

Disallow: /test/
Disallow: /wip/

# AI crawlers you want to exclude
Copy link
Contributor

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

User-agent: *
Allow: /

# Block duplicate or low-value paths
Copy link
Contributor

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: *
Copy link
Contributor

@poissoncorp poissoncorp Aug 1, 2025

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

Copy link
Member

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

@poissoncorp poissoncorp requested a review from gregolsky August 1, 2025 14:56

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"])
Copy link
Member

@gregolsky gregolsky Aug 1, 2025

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
Copy link
Member

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}",
Copy link
Member

@gregolsky gregolsky Aug 1, 2025

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.

Copy link
Member

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.

Copy link
Member

@gregolsky gregolsky left a 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/'
Copy link
Contributor

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

@ppekrol ppekrol merged commit a241833 into ravendb:new-docs Aug 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants