7

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

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
iMDroid
  • 2,108
  • 1
  • 16
  • 29
  • 1
    Here is the related PR in `firebase-tools` repo: https://github.com/firebase/firebase-tools/pull/949. Merged on Oct 16, 2018. – AKd Apr 21 '20 at 02:06
  • Another related PR to `firebase-tools`: https://github.com/firebase/firebase-tools/pull/999 – Splaktar Jun 17 '21 at 23:16

2 Answers2

15

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
Jainam Jhaveri
  • 1,479
  • 1
  • 18
  • 31
1

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.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
  • I do not want to delete it manually from the console in an automated process. And, running only "deploy" command works but I am integrating it in CI/CD hence I have to add "--non-interactive" with "deploy" which gives me above error. – iMDroid Aug 31 '18 at 03:49
  • If the CLI just doesn't do what you want, then file a feature request with the details of your use case. https://firebase.google.com/support/contact/bugs-features/ – Doug Stevenson Aug 31 '18 at 03:51