Skip to content

Commit

Permalink
chore(general): update local firebase environment settings (#795)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkue authored Apr 13, 2024
1 parent f865d90 commit 2092190
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 36 deletions.
15 changes: 11 additions & 4 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"projects": {
"default": "social-income-staging",
"default": "social-income-local",
"social-income-staging": "social-income-staging",
"social-income-prod": "social-income-prod"
},
"targets": {
"social-income-prod": {
"social-income-local": {
"hosting": {
"admin": [
"si-admin-production"
"si-admin-local"
]
}
},
Expand All @@ -18,7 +18,14 @@
"si-admin-staging"
]
}
},
"social-income-prod": {
"hosting": {
"admin": [
"si-admin-production"
]
}
}
},
"etags": {}
}
}
4 changes: 2 additions & 2 deletions admin/.env.development
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
VITE_WEBSITE_BASE_URL="http://localhost:3001"

VITE_ADMIN_FB_API_KEY="demo-key"
VITE_ADMIN_FB_AUTH_DOMAIN="social-income-staging"
VITE_ADMIN_FB_PROJECT_ID="social-income-staging"
VITE_ADMIN_FB_AUTH_DOMAIN="social-income-local"
VITE_ADMIN_FB_PROJECT_ID="social-income-local"
VITE_ADMIN_FB_AUTH_EMULATOR_URL="http://localhost:9099"
VITE_ADMIN_FB_FIRESTORE_EMULATOR_HOST="localhost"
VITE_ADMIN_FB_FIRESTORE_EMULATOR_PORT="8080"
Expand Down
8 changes: 4 additions & 4 deletions admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
"scripts": {
"build": "vite build",
"serve": "vite serve",
"serve:emulator": "firebase emulators:exec --project social-income-staging --only firestore,auth --config ../firebase.json --import ../seed 'npm run serve'",
"test:emulator": "firebase emulators:exec --project social-income-staging --only firestore,auth --config ../firebase.json --import ../seed 'npm run test:local'",
"serve:emulator": "firebase emulators:exec --project social-income-local --only firestore,auth --config ../firebase.json --import ../seed 'npm run serve'",
"test:emulator": "firebase emulators:exec --project social-income-local --only firestore,auth --config ../firebase.json --import ../seed 'npm run test:local'",
"test:local": "jest --forceExit --passWithNoTests --roots src",
"test:playwright:local": "npx playwright install --with-deps && playwright test --trace on",
"test:playwright:local:update": "npx playwright install --with-deps && playwright test --update-snapshots",
"test:playwright:emulator": "firebase emulators:exec --project social-income-staging --only firestore,auth --config ../firebase.json --import ../seed 'npm run test:playwright:local'",
"test:playwright:emulator:update": "firebase emulators:exec --project social-income-staging --only firestore,auth --config ../firebase.json --import ../seed 'npm run test:playwright:local:update'"
"test:playwright:emulator": "firebase emulators:exec --project social-income-local --only firestore,auth --config ../firebase.json --import ../seed 'npm run test:playwright:local'",
"test:playwright:emulator:update": "firebase emulators:exec --project social-income-local --only firestore,auth --config ../firebase.json --import ../seed 'npm run test:playwright:local:update'"
},
"devDependencies": {
"@firebase/rules-unit-testing": "^3.0.2",
Expand Down
14 changes: 1 addition & 13 deletions functions/.env.sample
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
# These environment variables are required to run tests with the emulator locally
GCLOUD_PROJECT="social-income-staging"
FIRESTORE_EMULATOR_HOST=127.0.0.1:8080
FIREBASE_AUTH_EMULATOR_HOST=127.0.0.1:9099

POSTFINANCE_PAYMENTS_FILES_BUCKET=postfinance-payments-files
POSTFINANCE_FTP_HOST=ftp.postfinance.example
POSTFINANCE_FTP_PORT=21
POSTFINANCE_FTP_USER=example
POSTFINANCE_FTP_RSA_PRIVATE_KEY="
-----BEGIN RSA PRIVATE KEY-----
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
...
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-----END RSA PRIVATE KEY-----
"
POSTFINANCE_FTP_RSA_PRIVATE_KEY_BASE64="CKSLI...."

# To work with the Twilio API locally, configure the test credentials from Twilio in your .env file
TWILIO_SID=ACXXXXXXXXXXXXXXXXXXXX
TWILIO_TOKEN=yyyyyyyyyyyyyyyyyyyyy
TWILIO_SENDER_PHONE=+15005550006
#CLOUD_FUNCTIONS_URL=http://localhost:5001/social-income-staging/us-central1
6 changes: 3 additions & 3 deletions functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"build": "tsc && npm run build:sync-files",
"build:sync-files": "rsync -av --delete ../shared/assets dist/shared && rsync -av --delete ../shared/locales dist/shared && rsync -av --delete ../shared/templates dist/shared",
"serve": "npm run build:sync-files && tsc --watch",
"test": "firebase emulators:exec --only firestore,storage,functions --project social-income-staging --config ../firebase.json 'npm run test:app'",
"test": "firebase emulators:exec --only firestore,storage,functions --project social-income-local --config ../firebase.json 'npm run test:app'",
"test:app": "jest --forceExit --roots src/",
"test:playwright": "firebase emulators:exec --project social-income-staging --only firestore --config ../firebase.json --import ../seed 'npx playwright install --with-deps && playwright test'",
"test:playwright:update": "firebase emulators:exec --project social-income-staging --only firestore --config ../firebase.json --import ../seed 'npx playwright install --with-deps && playwright test --update-snapshots'"
"test:playwright": "firebase emulators:exec --project social-income-local --only firestore --config ../firebase.json --import ../seed 'npx playwright install --with-deps && playwright test'",
"test:playwright:update": "firebase emulators:exec --project social-income-local --only firestore --config ../firebase.json --import ../seed 'npx playwright install --with-deps && playwright test --update-snapshots'"
},
"devDependencies": {
"@jest/globals": "^29.7.0",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"admin:test": "npm --workspace=@socialincome/admin run test:emulator",
"admin:test:playwright": "npm --workspace=@socialincome/admin run test:playwright:emulator",
"admin:test:playwright:update": "npm --workspace=@socialincome/admin run test:playwright:emulator:update",
"firebase:export": "firebase emulators:export --project social-income-staging --force ./seed",
"firebase:serve": "firebase emulators:start --project social-income-staging --config firebase.json --import ./seed",
"firebase:export": "firebase emulators:export --project social-income-local --force ./seed",
"firebase:serve": "firebase emulators:start --project social-income-local --config firebase.json --import ./seed",
"format-code": "prettier --write .",
"functions:build": "npm --workspace=@socialincome/functions run build",
"functions:deploy": "npm --workspace=@socialincome/functions run deploy",
Expand Down
2 changes: 1 addition & 1 deletion shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"private": true,
"scripts": {
"test": "firebase emulators:exec --only firestore,storage,functions --project social-income-staging --config ../firebase.json --import ../seed 'npm run test:app'",
"test": "firebase emulators:exec --only firestore,storage,functions --project social-income-local --config ../firebase.json --import ../seed 'npm run test:app'",
"test:app": "jest --forceExit --roots tests/ src/"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion website/.env.development
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# These environment variables are required so that the Firebase Admin SDK (server side) connects to the local emulator.
GCLOUD_PROJECT="social-income-staging"
GCLOUD_PROJECT="social-income-local"
FIRESTORE_EMULATOR_HOST=127.0.0.1:8080
FIREBASE_AUTH_EMULATOR_HOST=127.0.0.1:9099

Expand Down
12 changes: 6 additions & 6 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
"private": true,
"scripts": {
"serve": "next dev -p 3001",
"serve:emulator": "firebase emulators:exec --project social-income-staging --only firestore --config ../firebase.json --import ../seed 'npm run serve'",
"serve:emulator": "firebase emulators:exec --project social-income-local --only firestore --config ../firebase.json --import ../seed 'npm run serve'",
"build": "next build",
"build:emulator": "firebase emulators:exec --project social-income-staging --only firestore --config ../firebase.json --import ../seed 'npm run build'",
"build:emulator": "firebase emulators:exec --project social-income-local --only firestore --config ../firebase.json --import ../seed 'npm run build'",
"start": "next start -p 3001",
"start:emulator": "firebase emulators:exec --project social-income-staging --only firestore --config ../firebase.json --import ../seed 'npm run start'",
"start:emulator": "firebase emulators:exec --project social-income-local --only firestore --config ../firebase.json --import ../seed 'npm run start'",
"test": "jest --passWithNoTests",
"test:emulator": "firebase emulators:exec --project social-income-staging --only firestore --config ../firebase.json --import ../seed 'npm run test'",
"test:emulator": "firebase emulators:exec --project social-income-local --only firestore --config ../firebase.json --import ../seed 'npm run test'",
"test:e2e": "npx playwright install --with-deps && playwright test",
"test:e2e:emulator": "firebase emulators:exec --project social-income-staging --only firestore --config ../firebase.json --import ../seed 'npm run test:e2e'",
"test:e2e:emulator": "firebase emulators:exec --project social-income-local --only firestore --config ../firebase.json --import ../seed 'npm run test:e2e'",
"test:e2e:update": "npx playwright install --with-deps && playwright test --update-snapshots",
"test:e2e:update:emulator": "firebase emulators:exec --project social-income-staging --only firestore --config ../firebase.json --import ../seed 'npm run test:e2e:update'",
"test:e2e:update:emulator": "firebase emulators:exec --project social-income-local --only firestore --config ../firebase.json --import ../seed 'npm run test:e2e:update'",
"lint": "next lint"
},
"dependencies": {
Expand Down

0 comments on commit 2092190

Please sign in to comment.