Environment Management Quick Reference
Quick Commandsβ
Environment Switchingβ
# Switch to staging
firebase use staging
# Switch to production
firebase use production
# Check current environment
firebase use
Deploymentβ
# Deploy to staging
./deploy-staging.ps1
# Deploy to production
./deploy-production.ps1
# Manual deployment
firebase deploy --only apphosting --project toto-bo-stg # Staging
firebase deploy --only apphosting --project toto-bo # Production
Secret Managementβ
# Create new staging secret
gcloud secrets create secret-name --project=toto-bo-stg
# Grant access to App Hosting
firebase apphosting:secrets:grantaccess secret-name --backend toto-bo-stg --project toto-bo-stg
# Add secret value
echo "secret-value" | gcloud secrets versions add secret-name --data-file=- --project=toto-bo-stg
π Environment URLsβ
Productionβ
- Backoffice:
https://bo.betoto.pet - Main App:
https://app.betoto.pet - Wallet:
https://us-central1-toto-wallet-76e93.cloudfunctions.net
Stagingβ
- Backoffice:
https://stg.bo.betoto.pet - Main App:
https://stg.app.betoto.pet - Wallet:
https://us-central1-toto-wallet-stg.cloudfunctions.net
π Key Secretsβ
Staging (toto-bo-stg)β
stg-firebase-main-private-keystg-firebase-bo-private-keystg-sendgrid-api-key
Production (toto-bo)β
bo-firebase-main-private-keybo-firebase-bo-private-keybo-sendgrid-api-key
π Configuration Filesβ
- Staging:
apphosting.stg.yaml - Production:
apphosting.prod.yaml - Documentation:
ENVIRONMENTS.md
π― Workflowβ
- Develop β Local testing
- Stage β Push to
stagingbranch - Test β Validate in staging environment
- Deploy β Merge to
mainbranch
π¨ Important Notesβ
- β Always test in staging before production
- β
Use
firebase useto verify environment - β Staging and production are completely isolated
- β Never share secrets between environments