Issue working with multiple projects in the firebase-tools CLI

998 views
Skip to first unread message

Aurélien C

unread,
Jun 20, 2016, 7:57:21 PM6/20/16
to Firebase Google Group
Hi,

I just realized my firebase CLI does not upload to anything else than my first project imported in the new console.

I have to manually copy the rules from integration project, to the production project, in the console.

Maybe I'm doing something wrong?

Example commands (I changed the projects names):

Checking current projects:
$ firebase use
Active Project: default (myproj-int)

Project aliases for /redacted/42myproj:

* default (myproj-int)

Run firebase use --add to define a new project alias.

Trying to add a new project:
$ firebase use --add myproj-prod
Now using project myproj-prod

Seem to have no effect despite success message:
$ firebase use
Active Project: default (myproj-int)

Project aliases for /redacted/42myproj:

* default (myproj-int)

Run firebase use --add to define a new project alias.

Trying deploy, still on integration:
$ firebase deploy
=== Deploying to 'myproj-int'...
i  deploying database
i  starting release process (may take several minutes)...

✔  Deploy complete!


Visit the URL above or run firebase open

Even with the -P switch :
$ firebase deploy -P myproj-prod
=== Deploying to 'myproj-int'...

Note: my firebase project was named like '42myproj-xxx' back in v2, but after import, while some ID are still 24myproj, some other were changed to 'myproj-xxx', like for instance the Google Storage bucket, or the application alias in CLI. (see URLs above shown by firebase CLI)

Any advice ?

Thanks

Michael Bleigh

unread,
Jun 20, 2016, 8:14:07 PM6/20/16
to fireba...@googlegroups.com

firebase use --add is an interactive command to set up a new alias. So you would run that, then choose a name (e.g. “prod”) and pick a project.

You can also do:

firebase use myproj-prod --alias prod

To create a “prod” alias for myproj-prod. After either of these, you’d be able to do:

firebase use prod # switch to production
firebase use default # switch back to int

Hope that helps.

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/ac8ac699-32b0-4fec-bd96-8525fabcd6af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Aurélien C

unread,
Jun 21, 2016, 10:19:52 AM6/21/16
to Firebase Google Group
Thanks, using the alias it works !! I can now see multiple apps when running 'firebase use'

Otherwise - I tested again - it is not working when using only the app name without alias (also on 3.0.3 preview)

Maybe the CLI an alias is mandatory? If that's so, the help screen isn't very clear about it 

--
Aurelien
Reply all
Reply to author
Forward
0 new messages