Search code examples
firebasegoogle-cloud-platformgoogle-cloud-functionsfirebase-hostingfirebase-cli

Firebase Functions version of "Deploy to multiple environments"


As suggested here: "https://firebase.googleblog.com/2016/07/deploy-to-multiple-environments-with.html", one should use multiple projects (preferably name-differentiated into dev, staging, production, etc) to be able to have a test environment like that on Firebase Hosting.

But again, this document speaks about this approach in the context of Firebase Hosting. Is the same to be followed for Firebase Cloud Functions, if I do not want to update my already live, "production" function before testing the "development" version, or is there an alternate approach which can be followed?

I don't think I can simply add another Firebase Function, as code would still remain shared between the "production" version and the "development" version, which can cause problems in the "production" version.


Solution

  • The use of dedicated projects for each enviornment is the same recommended practice for all Firebase products.