From 6ffb2593993e6b46462f7ebc754c3bbd7f45eb98 Mon Sep 17 00:00:00 2001 From: kmd Date: Fri, 5 Jul 2024 23:40:32 -0700 Subject: [PATCH] Set envvars in a file for some reason. --- client/.env.prod | 1 + client/package.json | 2 +- client/src/api.js | 2 +- infra/app/app.tf | 13 ------------- infra/app/variables.tf | 2 +- 5 files changed, 4 insertions(+), 16 deletions(-) create mode 100644 client/.env.prod diff --git a/client/.env.prod b/client/.env.prod new file mode 100644 index 0000000..3521eac --- /dev/null +++ b/client/.env.prod @@ -0,0 +1 @@ +REACT_APP_API_BASE_URL=https://api.kmdcodes.com/ diff --git a/client/package.json b/client/package.json index fd3d92c..c0a5fc0 100644 --- a/client/package.json +++ b/client/package.json @@ -13,7 +13,7 @@ "scripts": { "start": "react-scripts start", "start:local": "env-cmd -f .env.local npm run-script start", - "build": "react-scripts build", + "build": "env-cmd -f .env.prod react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }, diff --git a/client/src/api.js b/client/src/api.js index 3ac6609..44f6b32 100644 --- a/client/src/api.js +++ b/client/src/api.js @@ -1,5 +1,5 @@ function getUrl(path) { - const baseUrl = process.env.REACT_APP_VOTING_API_BASE_URL; + const baseUrl = process.env.REACT_APP_API_BASE_URL; return baseUrl + path; } diff --git a/infra/app/app.tf b/infra/app/app.tf index d548d2a..16b759c 100644 --- a/infra/app/app.tf +++ b/infra/app/app.tf @@ -21,19 +21,6 @@ resource "google_cloud_run_v2_service" "client" { ports { container_port = 3000 } - - env { - name = "ENV" - value = "prod" - } - env { - name = "GOOGLE_CLOUD_PROJECT" - value = var.project - } - env { - name = "REACT_APP_VOTING_API_BASE_URL" - value = "https://${local.api_domain}" - } } service_account = google_service_account.client.email diff --git a/infra/app/variables.tf b/infra/app/variables.tf index 0b1f5ea..7cc59ac 100644 --- a/infra/app/variables.tf +++ b/infra/app/variables.tf @@ -1,7 +1,7 @@ variable "app_versions" { type = map(string) default = { - client : "0.2.1", + client : "0.2.1.p0", api : "0.1.1", }