Vik
Vik

Reputation: 9289

firebase CLI does not deploy to correct project

I am deploying the development and production branches using git source control. The functions have a .firebaserc as below

$ cat .firebaserc

{
  "projects": {
    "default": "doodlemobileapp-dev"
  }
}

firebase deploy works fine and deploys to indicated project. But when to production branch I can see that the .firebasderc contents changed:

$ cat .firebaserc 

{
  "projects": {
    "default": "doodlemobileapp"
  }
}

This indicates that it changed the contents perfectly. However, doing a firebase deploy still deploys to doodlemobileapp-dev instead of doodlemobileapp.

Upvotes: 0

Views: 4431

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 598718

You shouldn't change the .firebaserc file manually. Instead use the firebase use --project command to switch to a different project. See the documentation on project aliases

You could also set up separate targets within the same project, with https://firebase.google.com/docs/cli/targets. But I must admit I've never used that myself.

Upvotes: 4

Related Questions