SH10151
SH10151

Reputation: 974

How can I automate "firebase deploy"?

Is there any way I can automate my "firebase deploy" pushes to Firebase Hosting using a script? I can't seem to figure out how to do this.

Thanks.

Upvotes: 4

Views: 3390

Answers (2)

user10197811
user10197811

Reputation:

Open your terminal and run this command to generate a new CI token. this will help a lot if you are deploying your project on GitHub

npm install -g firebase-tools
firebase deploy --non-interactive --token $FIREBASE_TOKEN

to complete the automation process

firebase login:ci

personal suggestion: click here to see steps of using all commands

Upvotes: 0

petecarapetyan
petecarapetyan

Reputation: 61

Here's a couple different approaches:

Firebase's own David East on how to do it with Travis and GitHub https://www.youtube.com/watch?v=QLVzozWDYAs

I took an alternate approach, since my automation tool is written in java.

  • firebase CLI installed in the bash shell, previous to launching my java binary.
  • [deploy.sh] shell script runs "firebase deploy" command.
  • java binary has internal code to run the [deploy.sh] script.

Bottom line - no matter what your automation binary is written in, as long as it can shell out and run your [deploy.sh] script in the same shell that firebase is installed in, you should be good to go.

Upvotes: 2

Related Questions