From af0f9d4218671fc38e8ed19334b115f8d10ce41b Mon Sep 17 00:00:00 2001 From: Jan-Erik Rediger Date: Tue, 8 Jul 2025 17:00:42 +0200 Subject: [PATCH 1/3] Use the correct environment variable --- doc/deployment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/deployment.md b/doc/deployment.md index f8e85f6..5cedda2 100644 --- a/doc/deployment.md +++ b/doc/deployment.md @@ -50,7 +50,7 @@ PROJECT_ID=glean-debug-view-dev-237806 Then create subscriptions: ```shell script -PROJECT_NUMBER=$(gcloud projects list --filter="$PROJECT" --format="value(PROJECT_NUMBER)") +PROJECT_NUMBER=$(gcloud projects list --filter="$PROJECT_ID" --format="value(PROJECT_NUMBER)") gcloud config set project $PROJECT_ID From f2ee51a8f60dc3bd27a99a8a1842f63042341918 Mon Sep 17 00:00:00 2001 From: Jan-Erik Rediger Date: Tue, 8 Jul 2025 17:05:23 +0200 Subject: [PATCH 2/3] Clean up deployment docs This should make it more clear that the frontend needs to be rebuild for the correct environment before deployment. --- doc/deployment.md | 57 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 45 insertions(+), 12 deletions(-) diff --git a/doc/deployment.md b/doc/deployment.md index 5cedda2..c81eae2 100644 --- a/doc/deployment.md +++ b/doc/deployment.md @@ -1,54 +1,87 @@ # Deployment + This projects leverages two GCP projects to separate development and production environments: + * `glean-debug-view-dev-237806` - dev project * `debug-ping-preview` - production -## Building React frontend -React application contains environment-specific configuration, therefore for deployment to one of the environments it needs to be built with corresponding profile. It can be controlled with `REACT_APP_ENV` environment variable. +React application contains environment-specific configuration, therefore for deployment to one of the environments it needs to be built with corresponding profile. +It can be controlled with `REACT_APP_ENV` environment variable. + +## Deploy a development build + +Build the React frontend: -In order to prepare production build, run: ``` -REACT_APP_ENV=prod npm run build +REACT_APP_ENV=dev npm run build ``` -For development build: + +Deploy the frontend: + ``` -REACT_APP_ENV=dev npm run build +firebase use dev +firebase deploy --only hosting +``` + +## Deploy a production build + +Build the React frontend: + +``` +REACT_APP_ENV=prod npm run build ``` -## Deploying -For deploying to production, switch firebase to production project: +Deploy the frontend: + ``` firebase use prod +firebase deploy --only hosting ``` -for development environment: + +## Deploy the functions + +First select the right environment. + +For the development environment: + ``` firebase use dev ``` -Then project can be deployed with: + +For the production environment: + ``` -firebase deploy +fireabase use prod ``` -We can also deploy only selected component, for example functions: + +Then deploy the functions: + ``` firebase deploy --only functions ``` ## PubSub configuration + +_Note: This should be rarely needed as PubSub is already deployed and configured correctly._ + PubSub subscriptions are needed to consume pings from the pipeline. They are pushing messages to non-public HTTP functions, therefore need to authenticate. Here's how to configure them: First, select the project id: For production run: + ```shell script PROJECT_ID=debug-ping-preview ``` For dev: + ```shell script PROJECT_ID=glean-debug-view-dev-237806 ``` Then create subscriptions: + ```shell script PROJECT_NUMBER=$(gcloud projects list --filter="$PROJECT_ID" --format="value(PROJECT_NUMBER)") From 763252d833dfc75953aa7a2f858157714c86d3db Mon Sep 17 00:00:00 2001 From: Jan-Erik Rediger Date: Tue, 8 Jul 2025 17:16:30 +0200 Subject: [PATCH 3/3] Update doc/deployment.md Co-authored-by: Ben Wu <12437227+BenWu@users.noreply.github.com> --- doc/deployment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/deployment.md b/doc/deployment.md index c81eae2..bb8b145 100644 --- a/doc/deployment.md +++ b/doc/deployment.md @@ -51,7 +51,7 @@ firebase use dev For the production environment: ``` -fireabase use prod +firebase use prod ``` Then deploy the functions: