Firebase deploy function --non-interactive

Viewed 4746

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??

2 Answers

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

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.

Related