Skip to content

Latest commit

Β 

History

History
55 lines (43 loc) Β· 1.29 KB

README.md

File metadata and controls

55 lines (43 loc) Β· 1.29 KB

Module: R2 Sync

dagger-min-version deno compatibility

Sync files from local directory to Cloudflare R2.

It uses aws-cli, so you can use it on any S3 compatible storage.

πŸš€ Usage

dagger -m github.com/tsirysndr/daggerverse/r2-sync \
  call upload \
  --src <source> \
  --bucket <bucket> \
  --access-key <access-key-id> \
  --secret-key <secret-access-key> \
  --endpoint <endpoint>
dagger call -m github.com/tsirysndr/daggerverse/r2-sync dev --src <source> terminal

πŸ§‘β€πŸ”¬ Example

dagger -m github.com/tsirysndr/daggerverse/r2-sync \
  call upload \
  --src . \
  --bucket demo \
  --access-key $ACCESS_KEY \
  --secret-key $SECRET_KEY \
  --endpoint https://$ACCOUNT_ID.r2.cloudflarestorage.com
dagger call -m github.com/tsirysndr/daggerverse/r2-sync dev --src . terminal

πŸ§‘β€πŸ’» Programmatic usage

import { lint } from 'jsr:@fx/r2-sync';

await upload(
  ".",
  "demo",
  Deno.env.get("ACCESS_KEY")!,
  Deno.env.get("SECRET_KEY")!,
  `https://${Deno.env.get("ACCOUNT_ID")!}.r2.cloudflarestorage.com`
);