Open samtstern opened 3 years ago
It seems like changing my firebase.json to the following makes the deploy do what I want:
{
"database": [
{
"instance": "fir-dumpster-europe",
"rules": "database.rules.json"
}
]
}
So it's possible this is not a bug but more of a question: should I be able to deploy the default database.rules
to a particular RTDB instance by specifying it with the database:instanceName
syntax at the command line?
Some more details on why it seems like this is unexpected behavior. Consider the following firebase.json file:
{
"database": [
{
"instance": "fir-dumpster-europe",
"rules": "database.rules.json"
},
{
"instance": "fir-dumpster-asia",
"rules": "database.rules.json"
}
]
}
If I run the command:
firebase --debug deploy --only database:fir-dumpster-europe
It will update fir-dumster-asia
also, even though I specify --only database:fir-dumpster-europe
For the next users who end up on this page like me, after a dig in documentation and a lot of tests, the name after database:
is a target name, not an instance name.
You need to create targets (group of instances per example) and you can after deploy rules only for one of these targets using the command you specified. https://firebase.google.com/docs/cli/targets
[REQUIRED] Environment info
firebase-tools: 9.2.0
Platform: macOs
[REQUIRED] Test case
I have a project,
fir-dumpster
with three databases:[REQUIRED] Steps to reproduce
Try to deploy rules to the second instance using this command:
[REQUIRED] Expected behavior
Update the rules of
fir-dumpster-europe.europe-west1.firebasedatabase.app
[REQUIRED] Actual behavior
Deploys to the default instance, see logs below: