独立的开发和生产 Firebase 环境 [英] Separate dev and prod Firebase environment

查看:25
本文介绍了独立的开发和生产 Firebase 环境的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑使用 Firebase 作为 MBaaS,但是我找不到任何可靠的解决方案来解决以下问题:

I am considering using Firebase as MBaaS, however I couldn't find any reliable solution to the following problem:

我想设置两个独立的 Firebase 环境,一个用于开发,一个用于生产,但我不想在两个环境之间手动复制功能(例如远程配置设置、通知规则等)开发和生产环境.

I would like to set up two separate Firebase environments, one for development and one for production, but I don't want to do a manual copy of features (eg. remote configuration setup, notification rules, etc.) between the development and production environment.

有什么我可以依赖的工具或方法吗?从头开始设置远程配置或通知规则可能是一项艰巨的任务,而且风险太大.

Is there any tool or method I can rely on? Setting up remote configuration or notification rules from scratch can be a daunting task and too risky.

有什么建议吗?有没有比拥有两个独立的环境更好的方法?

Any suggestions? Is there a better approach than having two separate environments?

在发布另一个解释如何设置单独 Firebase 帐户的问题的答案之前:这不是问题,请再次阅读.问题是:如何在单独的开发和生产帐户之间转移更改,或者比在它们之间手动复制更好的解决方案.

推荐答案

正如大家所指出的 - 您需要多个项目/数据库.

As everyone has pointed out - you need more than one project/database.

但是要回答您关于需要能够将设置/数据等从开发复制到生产的问题.我有完全相同的需求.几个月的开发和测试,我不想手动复制数据.

But to answer your question regarding the need to be able to copy settings/data etc from development to production. I had the exact same need. A few months in development and testing, I didn't want to manually copy the data.

我的结果是将数据备份到一个存储桶,然后从那里将其恢复到另一个数据库中.这是一种非常粗略的方法 - 我做了一个完整的数据库备份/恢复 - 但你也许可以朝这个方向寻找一种更可控的方式.我没有用过它 - 它很新 - 但这可能是一个解决方案:NPM Module firestore-导出导入

My result was to backup the data to a storage bucket, and then restore it from there into the other database. It's a pretty crude way to do it - and I did a whole database backup/restore - but you might be able to look in that direction for a more controlled way. I haven't used it - it's very new - but this might be a solution: NPM Module firestore-export-import

编辑:此处的 Firestore 备份/导出/导入信息Cloud Firestore 导出和导入数据

Edit: Firestore backup/export/import info here Cloud Firestore Exporting and Importing Data

如果您使用的是 Firebase RTDB,而不是 Firestore - 此文档可能会有所帮助:Firebase 自动备份

If you're using Firebase RTDB, and not Firestore - this documentation might help: Firebase Automated Backups

您需要正确设置权限,以允许您的生产数据库访问与您的开发相同的存储桶.祝你好运.

You will need to set the permissions correctly to allow your production database access to the same storage bucket as your development. Good luck.

这篇关于独立的开发和生产 Firebase 环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆