env var fixes

This commit is contained in:
Max Howell 2022-09-12 07:48:12 -04:00
parent 80cd3324e9
commit e1a24d562d
3 changed files with 5 additions and 5 deletions

View file

@ -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 = []

View file

@ -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)

View file

@ -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) })()