Skip to content

Conversation

@marcocastignoli
Copy link
Member

@marcocastignoli marcocastignoli commented Nov 4, 2025

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
@marcocastignoli marcocastignoli requested a review from d-xo November 5, 2025 14:35
@marcocastignoli
Copy link
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
Copy link
Member

@r0qs r0qs left a comment

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.

separator=""
for path in "${purge_paths[@]}"; do
purge_payload+="${separator}\"https://${cloudflare_cache_host}${path}\""
separator=","
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume the trailing comma at the end of purge_payload will not cause problems?

Copy link
Member Author

Choose a reason for hiding this comment

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

it's not at the end, it's at the beginning. the separator is "" for the first one (prefix) and then , "others"

@marcocastignoli marcocastignoli moved this to Sprint - Needs Review in Sourcify Public Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Sprint - Needs Review

Development

Successfully merging this pull request may close these issues.

5 participants