diff --git a/backend/README.md b/backend/README.md index 0267517b4..7aca0e488 100644 --- a/backend/README.md +++ b/backend/README.md @@ -31,7 +31,7 @@ Names and regions should match above. ### Deploy -1. Update `bucket` in `backend/server.js` +1. Update `GCS_BUCKET` in `backend/app.yaml` 2. Create the files to deploy: `VITE_ON_GCP="true" VITE_RESOURCE_BASE="https://atip-test-2.ew.r.appspot.com/data" npm run build && cd backend && rm -rf dist && cp -R ../dist .` - Note we could make Cloud Build do this, but we'd have to get `wasm-pack` and other things set up there first - GH Actions will eventually trigger CI deployments for our test environment, and we've already done the work of configuring that build environment diff --git a/backend/app.yaml b/backend/app.yaml index 28b5cb8ee..0a595f31f 100644 --- a/backend/app.yaml +++ b/backend/app.yaml @@ -1 +1,3 @@ runtime: nodejs18 +env_variables: + GCS_BUCKET: "atip-test-2" diff --git a/backend/server.js b/backend/server.js index 879d067ad..de6be3566 100644 --- a/backend/server.js +++ b/backend/server.js @@ -7,7 +7,9 @@ import express from "express"; // This automatically finds gcloud credentials when running locally or the // service account on GAE let storage = new Storage(); -let bucket = "atip-test-2"; +// TODO Upfront check the bucket is accessible and has some expected files, so +// we could failfail for a bad deployment +let bucket = process.env.GCS_BUCKET; let app = express(); diff --git a/src/pages/BrowseSchemes.svelte b/src/pages/BrowseSchemes.svelte index 74697575f..7ed688d6f 100644 --- a/src/pages/BrowseSchemes.svelte +++ b/src/pages/BrowseSchemes.svelte @@ -93,7 +93,7 @@

Browse schemes

- {#if import.meta.env.VITE_ON_GCP == "true"} + {#if import.meta.env.VITE_ON_GCP === "true"} {/if}