From e1a24d562d75c1c5a40220ebeb575ad4a4b35834 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Mon, 12 Sep 2022 07:48:12 -0400 Subject: [PATCH] env var fixes --- scripts/inventory.ts | 4 ++-- scripts/upload-sync.ts | 4 ++-- scripts/upload.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/inventory.ts b/scripts/inventory.ts index f0ac55df..dfc47d6b 100755 --- a/scripts/inventory.ts +++ b/scripts/inventory.ts @@ -5,7 +5,7 @@ args: - deno - run - --allow-net - - --allow-env=AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,S3_BUCKET + - --allow-env=AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,S3_BUCKET,AWS_S3 - --import-map={{ srcroot }}/import-map.json ---*/ @@ -20,7 +20,7 @@ const s3 = new S3({ region: "us-east-1", }); -const bucket = s3.getBucket(Deno.env.get("S3_BUCKET")!); +const bucket = s3.getBucket(Deno.env.get("AWS_S3") ?? Deno.env.get("S3_BUCKET")!); const inventory: Inventory = {} const flat = [] diff --git a/scripts/upload-sync.ts b/scripts/upload-sync.ts index 71596005..72eddb60 100755 --- a/scripts/upload-sync.ts +++ b/scripts/upload-sync.ts @@ -6,7 +6,7 @@ args: - run - --allow-net - --allow-read={{ tea.prefix }}/tea.xyz/var/www - - --allow-env=AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,S3_BUCKET + - --allow-env=AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,S3_BUCKET,AWS_S3 - --import-map={{ srcroot }}/import-map.json ---*/ @@ -22,7 +22,7 @@ const s3 = new S3({ region: "us-east-1", }); -const bucket = s3.getBucket(Deno.env.get("S3_BUCKET")!); +const bucket = s3.getBucket(Deno.env.get("AWS_S3") ?? Deno.env.get("S3_BUCKET")!); for (const pkg of await useCache().ls()) { const key = useCache().s3Key(pkg) diff --git a/scripts/upload.ts b/scripts/upload.ts index c850b270..bc373cfb 100755 --- a/scripts/upload.ts +++ b/scripts/upload.ts @@ -26,7 +26,7 @@ const s3 = new S3({ region: "us-east-1", }) -const bucket = s3.getBucket(Deno.env.get("AWS_S3")!) +const bucket = s3.getBucket(Deno.env.get("AWS_S3") ?? Deno.env.get("S3_BUCKET")!) const encode = (() => { const e = new TextEncoder(); return e.encode.bind(e) })()