Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Download or sync Firebase Functions to local environment

I am working on a Firebase project that currently uses several Cloud Functions. The thing is that I want to download or sync the Cloud Functions to the local environment on my laptop.

I mean some command using firebase-tools or another like:

git clone [project name]
git fetch [something]

Usually, we create some cloud functions using the Firebase Console, and I would like to have these functions locally to edit these when needed and deploy them again.

I know that firebase-tools have these two commands, but it is only for configurations:

functions:config:clone [options]
functions:config:get [options]
like image 494
Yulio Aleman Jimenez Avatar asked Jul 28 '20 17:07

Yulio Aleman Jimenez


People also ask

Can you use Firebase locally?

The Firebase Local Emulator Suite is a set of advanced tools for developers looking to build and test apps locally using Cloud Firestore, Realtime Database, Cloud Storage, Authentication, Cloud Functions, Pub/Sub, Firebase Hosting and Firebase Extensions.


1 Answers

There's no provided solution for automatically copying or synchronizing functions that have already been deployed. You can certain get the source code for deployed functions, but the Firebase CLI will not automate that process for you.

Ideally, you will want to manage all of your functions from the same source control and CLI in order to deal with them all consistent. Editing functions from the console is primarily a convenience, not a proper deployment mechanism.

like image 190
Doug Stevenson Avatar answered Oct 10 '22 00:10

Doug Stevenson