Skip to content

Update sync script to support Cloudflare R2 and CDN cache purging#169

Merged
marcocastignoli merged 12 commits into
gh-pagesfrom
feat/sync-s3-update
Nov 26, 2025
Merged

Update sync script to support Cloudflare R2 and CDN cache purging#169
marcocastignoli merged 12 commits into
gh-pagesfrom
feat/sync-s3-update

Conversation

@marcocastignoli

@marcocastignoli marcocastignoli commented Nov 4, 2025

Copy link
Copy Markdown
Member

Instructions to test the script

The script will delete the .git folder, so before proceeding

tmpdir=$(mktemp -d) && cd "$tmpdir"
cp /Users/marcocastignoli/Projects/solc-bin/sync-r2.sh .
git init
echo "hello r2" > nightly-build.txt
git add sync-r2.sh nightly-build.txt
git commit -m "Test payload for R2 sync"

Then set the environment variables

export R2_ACCOUNT_ID=
export R2_ZONE=
export R2_BUCKET_NAME=
export CLOUDFLARE_ZONE_ID=
export CLOUDFLARE_CACHE_HOST=
export CLOUDFLARE_API_TOKEN=
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=
export AWS_DEFAULT_REGION=

Finally run the script

./sync-r2.sh "$R2_ACCOUNT_ID" "$R2_ZONE" "$R2_BUCKET_NAME" "$CLOUDFLARE_ZONE_ID" "$CLOUDFLARE_CACHE_HOST" "$CLOUDFLARE_API_TOKEN"

@marcocastignoli
marcocastignoli marked this pull request as draft November 4, 2025 17:04
Comment thread sync-s3.sh
@marcocastignoli
marcocastignoli requested a review from d-xo November 5, 2025 14:35
@marcocastignoli

Copy link
Copy Markdown
Member Author

I tested the script locally with some dummy files and it's working. Soon @clonker will run the script with a local copy he has of the full repository.

@marcocastignoli
marcocastignoli marked this pull request as ready for review November 6, 2025 11:27
Comment thread sync-s3.sh Outdated

@r0qs r0qs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice. Thanks a lot for that @marcocastignoli! It looks good to me. Just a small comment.

Comment thread sync-r2.sh Outdated
Comment thread sync-r2.sh Outdated
Comment thread sync-r2.sh
@marcocastignoli marcocastignoli moved this to Sprint - Needs Review in Sourcify Public Nov 6, 2025

@cameel cameel left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Job name should be updated and perhaps the PR could use a few tweaks (see my comments), but overall seems good.

Comment thread .github/workflows/mirror-content.yml
Comment thread sync-r2.sh Outdated
Comment thread sync-r2.sh Outdated
Comment thread sync-r2.sh Outdated

@cameel cameel left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me. Let's try it out!

Comment thread sync-r2.sh Outdated
@cameel

cameel commented Nov 26, 2025

Copy link
Copy Markdown
Collaborator

Oh, just please squash the commits before merging.

Does not have to be one commit, but if there are more, each one should be one logical change that goes straight to the point, without all the back and forth from the review comments, because that's just noise when you look at history and try to figure out what changed.

@marcocastignoli
marcocastignoli merged commit c084913 into gh-pages Nov 26, 2025
5 of 6 checks passed
@marcocastignoli
marcocastignoli deleted the feat/sync-s3-update branch November 26, 2025 15:02
@github-project-automation github-project-automation Bot moved this from Sprint - Needs Review to Sprint - Done in Sourcify Public Nov 26, 2025
@marcocastignoli marcocastignoli moved this from Sprint - Done to COMPLETED in Sourcify Public Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: COMPLETED

Development

Successfully merging this pull request may close these issues.

5 participants