diff --git a/.firebaserc b/.firebaserc index 7536d832..56c94657 100644 --- a/.firebaserc +++ b/.firebaserc @@ -1,7 +1,7 @@ { "projects": { - "default": "cioos-metadata-form", - "dev": "cioos-metadata-form-dev" + "default": "cioos-metadata-form-8d942", + "dev": "cioos-metadata-form-dev-258dc" }, "targets": {}, "etags": {} diff --git a/.github/workflows/firebase-hosting-delete-channel.yml b/.github/workflows/firebase-hosting-delete-channel.yml index 948de945..924fd6d3 100644 --- a/.github/workflows/firebase-hosting-delete-channel.yml +++ b/.github/workflows/firebase-hosting-delete-channel.yml @@ -19,5 +19,5 @@ jobs: args: hosting:channel:delete pr${{github.event.number}}-${{steps.get-short-name.outputs.id}} --force env: FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} - PROJECT_ID: cioos-metadata-form-dev + PROJECT_ID: cioos-metadata-form-dev-258dc GITHUB_AUTH: ${{ secrets.ISSUE_CREATOR_PAT }} \ No newline at end of file diff --git a/.github/workflows/firebase-hosting-pull-request.yml b/.github/workflows/firebase-hosting-pull-request.yml index 0b1d48b5..7053ac45 100644 --- a/.github/workflows/firebase-hosting-pull-request.yml +++ b/.github/workflows/firebase-hosting-pull-request.yml @@ -26,7 +26,7 @@ jobs: firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_CIOOS_METADATA_FORM }}' expires: 30d entryPoint: '.' - projectId: cioos-metadata-form-dev + projectId: cioos-metadata-form-dev-258dc env: FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} GMAIL_USER: ${{ secrets.GMAIL_USER }} diff --git a/.gitignore b/.gitignore index ce230ee1..a230e760 100644 --- a/.gitignore +++ b/.gitignore @@ -39,4 +39,6 @@ firebase-debug.log .Rproj.user yarn.lock -.env \ No newline at end of file +.env +.env.* +*.log \ No newline at end of file diff --git a/README.md b/README.md index 470bb5cc..94084ef1 100644 --- a/README.md +++ b/README.md @@ -73,12 +73,12 @@ We use a GitHub Actions workflow named `firebase-deploy` for deploying Firebase ### Deploying to Development Project -To deploy updated Firebase functions to the "cioos-metadata-form-dev" development project, follow these steps: +To deploy updated Firebase functions to the "cioos-metadata-form-dev-258dc" development project, follow these steps: -1. **Ensure your local setup is linked to the correct Firebase project** by using the Firebase CLI to login and select the "cioos-metadata-form-dev" project. +1. **Ensure your local setup is linked to the correct Firebase project** by using the Firebase CLI to login and select the "cioos-metadata-form-dev-258dc" project. ```bash - firebase use cioos-metadata-form-dev + firebase use cioos-metadata-form-dev-258dc ``` 2. **Make necessary changes to your Firebase functions.** @@ -103,7 +103,7 @@ The workflow utilizes the following secrets to create the virtual `.env` file fo - `GITHUB_AUTH` used to push to github pages branch and other github action type stuff - `REACT_APP_DEV_DEPLOYMENT` used to switch between development and production databases. Default False, set to True to use Dev database - `REACT_APP_GOOGLE_CLOUD_API_KEY` found at https://console.cloud.google.com/apis/credentials?project=cioos-metadata-form -- `REACT_APP_GOOGLE_CLOUD_API_KEY_DEV` found at https://console.cloud.google.com/apis/credentials?project=cioos-metadata-form-dev +- `REACT_APP_GOOGLE_CLOUD_API_KEY_DEV` found at https://console.cloud.google.com/apis/credentials?project=cioos-metadata-form-dev-258dc ### Using Parameterized Configuration in Firebase Functions @@ -137,12 +137,12 @@ Deploying Firebase Realtime Database security rules via the Firebase CLI is reco ### Define targets -This project has two databases: `cioos-metadata-form` (this is the default/main db for production) and `cioos-metadata-form-dev` (dev). +This project has two databases: `cioos-metadata-form` (this is the default/main db for production) and `cioos-metadata-form-dev-258dc` (dev). Use Firebase CLI targets to manage rules deployment: ```bash firebase target:apply database prod cioos-metadata-form -firebase target:apply database dev cioos-metadata-form-dev +firebase target:apply database dev cioos-metadata-form-dev-258dc ``` ### Configure firebase.json @@ -188,10 +188,10 @@ When hosting the application in a new place there are a couple of things to upda - You must add your new domain to the allowed list for authenication in firebase. https://console.firebase.google.com/u/0/project/cioos-metadata-form/authentication/settings - https://console.firebase.google.com/u/0/project/cioos-metadata-form-dev/authentication/settings + https://console.firebase.google.com/u/0/project/cioos-metadata-form-dev-258dc/authentication/settings - You have to allow your domain under Website restrictions for the firebase browser key https://console.cloud.google.com/apis/credentials/key/405d637a-efd4-48f5-95c6-f0af1d7f4889?project=cioos-metadata-form - https://console.cloud.google.com/apis/credentials/key/23d360a3-4b55-43f2-bc1c-b485371c0e07?project=cioos-metadata-form-dev + https://console.cloud.google.com/apis/credentials/key/23d360a3-4b55-43f2-bc1c-b485371c0e07?project=cioos-metadata-form-dev-258dc \ No newline at end of file diff --git a/firebase-functions/.firebaserc b/firebase-functions/.firebaserc index 71dcf944..c52d8663 100644 --- a/firebase-functions/.firebaserc +++ b/firebase-functions/.firebaserc @@ -1,26 +1,26 @@ { "projects": { - "default": "cioos-metadata-form", - "dev": "cioos-metadata-form-dev" + "default": "cioos-metadata-form-8d942", + "dev": "cioos-metadata-form-dev-258dc" }, "targets": { "cioos-metadata-form": { "database": { "prod": [ - "cioos-metadata-form" + "cioos-metadata-form-8d942" ], "dev": [ - "cioos-metadata-form-dev" + "cioos-metadata-form-dev-258dc" ] } }, "development": { "database": { "prod": [ - "cioos-metadata-form" + "cioos-metadata-form-8d942" ], "dev": [ - "cioos-metadata-form-dev" + "cioos-metadata-form-dev-258dc" ] } } diff --git a/firebase-functions/functions/package-lock.json b/firebase-functions/functions/package-lock.json index 0ba06238..dcd69c04 100644 --- a/firebase-functions/functions/package-lock.json +++ b/firebase-functions/functions/package-lock.json @@ -18,7 +18,7 @@ "firebase-functions-test": "^0.2.0" }, "engines": { - "node": "14" + "node": "20" } }, "node_modules/@babel/parser": { diff --git a/src/firebase.js b/src/firebase.js index 96019e3b..8a080fcc 100644 --- a/src/firebase.js +++ b/src/firebase.js @@ -6,7 +6,7 @@ const deployedOnTestServer = process.env.REACT_APP_DEV_DEPLOYMENT; const prodConfig = { // see https://console.cloud.google.com/apis/credentials?project=cioos-metadata-form - // and https://console.cloud.google.com/apis/credentials?project=cioos-metadata-form-dev + // and https://console.cloud.google.com/apis/credentials?project=cioos-metadata-form-dev-258dc // for api key location which is then stored in a github secret and added to several // github actions to support testing and deployment. // see https://firebase.google.com/docs/projects/api-keys for a discussion of why we @@ -19,7 +19,7 @@ const prodConfig = { storageBucket: "cioos-metadata-form-8d942.appspot.com", messagingSenderId: "467286137979", appId: "1:467286137979:web:250b09e3db2a56716016de", - measurementId: "G-BEMJG40RHN" + measurementId: "G-BEMJG40RHN", }; const devConfig = { @@ -30,7 +30,7 @@ const devConfig = { storageBucket: "cioos-metadata-form-dev-258dc.appspot.com", messagingSenderId: "141560007794", appId: "1:141560007794:web:861d99b02210ea4d17c6eb", - measurementId: "G-BSKRHNR1EW" + measurementId: "G-BSKRHNR1EW", };