Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase deploy function --non-interactive

I am integrating CI/CD for deploying my firebase functions.

firebase use PROJECTID --token FIREBASE_TOKEN
firebase deploy --token FIREBASE_TOKEN --non-interactive

Now whenever a function is deleted from index.js, it throws the following exception.

Error: The following functions are found in your project but do not exist in your local source code: httpSeeding(us-central1) Aborting because deletion cannot proceed in non-interactive mode. To fix, manually delete the functions by running: firebase functions:delete httpSeeding --region us-central1

Is there a way in the non-interactive mode where a deleted functions are removed from the console without running firebase functions:delete httpSeeding??

like image 500
iMDroid Avatar asked Aug 30 '18 12:08

iMDroid


People also ask

What does Firebase deploy -- only functions do?

Running firebase deploy --only functions deletes the existing functions before creating new ones.

Can I use Firebase functions for free?

Cloud Functions includes a perpetual free tier for invocations to allow you to experiment with the platform at no charge. Note that even for free tier usage, we require a valid billing account.

Can I use Python for Firebase functions?

You can certainly write Cloud Firestore triggers in python and deploy them with gcloud. One thing you might not be aware of: the underlying Cloud Functions product is the same no matter how you deploy your functions. Firebase just adds tools and APIs on top of the existing Google Cloud Functions infrastructure.


2 Answers

Just run the same deploy command from your shell. It will automatically delete functions that are missing from your source.

Also you can delete functions directly from the Cloud console.

like image 21
Doug Stevenson Avatar answered Sep 24 '22 22:09

Doug Stevenson


Run deploy with -f option, it should delete extra functions in non-interactive mode

firebase deploy --token FIREBASE_TOKEN -f

From the docs available by running firebase help deploy, we see following option:

 -f, --force delete Cloud Functions missing from the current working directory without confirmation
like image 119
Jainam Jhaveri Avatar answered Sep 23 '22 22:09

Jainam Jhaveri