Here we go, new project incoming!
Post-creation steps
Creating a Firebase project is straightforward. But there's a few steps that need to be done right after doing that to prepare for some dev work.
Installing/updating the Firebase CLI
Working with Firebase requires using the CLI for it. I need to grab the latest version of it, so I fire up a terminal (I'm using Windows Terminal, and WSL) and grab it with npm install -g firebase-tools
Next, I just do a firebase login
to log in and make sure I have access to the project.
Upgrading billing
One of the reasons I recommend Firebase so much for anyone who wants to host a serverless project (such as people making websites in Vue/React and need a login system and databases), is that the free tier is truly excellent - the free limits are very generous (you can see them on their pricing page ).
However, I need to access the rest of the Google Cloud projects, since I intend to use services like Cloud Tasks. So I will need to upgrade my account from the free one to the pay-a-you-go one sooner rather than later. Fortunately, this plan still has access to the free tier, so I'd only be paying what I needed (which isn't much).
At the same time, I will set up some billing alerts just to keep an eye on things.
Getting a CI token
I like to be able to deploy stuff simply by making a git commit. This is the job of CI/CD, which I'll set up later, but in the mean time since we're here setting up the Firebase project, I will go fetch the CI token, a small secret token that allows the bearer to make deployments without logging in.
There's a small wrinkle in the plan though: Firebase doesn't have a very good access control: You can't add service accounts that have access to Firebase-specific features like updating the hosting, like you can with Google Cloud proper. Instead you have to use a personal CI token. I don't really like this idea because a personal CI token gives deploy access to ALL of the firebase projects associated with that account, so exposing the token to unauthorized use could potentially impact everything. So, I will have to go about the circuitous route of creating a new GMail account first, adding that to the project with limited permissions, and then fetching a CI token for it. I think it's these two permissions I'll need, but I'll find out later when I try it.
Finally, running firebase login:ci
and using this new GMail account for logging in, should give me a CI token that only has the permissions I assigned it.
Top comments (0)