Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you un-deploy Cloud Functions for Firebase?

I was experimenting with Cloud Functions for Firebase and deployed one of the samples in the functions-samples repo and linked it to an existing project using firebase use --add.

Since I was just playing around, these files were not added to my version control, and I no longer have access to the machine this was done on. I would like to build on this function or create new ones, but I am unsure how to either 1) modify and re-deploy over the original function or 2) un-use --add and start fresh. I see the function in my firebase console but no 'delete' or 'remove' button and have read through the CLI docs looking for clues to no avail.

Thanks for adding functions to the firebase 'stack.' Any guidance is much appreciated.

like image 875
HowlingFantods Avatar asked Mar 16 '17 17:03

HowlingFantods


People also ask

How do I undo firebase deployment?

Go to Firebase Console and select Hosting from the menu of the left. You will see the deployed project with a list of your historical actions like Deployed , disabled , etc. Only after you have disabled the site, the "three vertical dots" menu will be available for you to choose the action to delete the deployment.

How do I delete a cloud function?

Go to Google Cloud Console Cloud Functions and select project, then select the function you want to undeploy or delete. Select it and click delete.

How do I change the deployed cloud function?

Deploy from the Google Cloud console inline editorIn the Source code field, select Inline Editor. Use the provided editor to create or edit source files as necessary - see Source directory structure. The left pane lists your source files and allows you to create, rename, and delete files.

What does firebase deploy -- only functions do?

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


1 Answers

Functions get deleted when they aren't present during a firebase deploy. Most commonly that'd be because because you removed the function from your index.js, but if you've removed the whole functions directory that'll work too.

To continue work on a function for which you don't have the source anymore, the easiest is to start fresh. The function(s) you deploy will replace the ones you deployed previously.

Alternatively, if you're partial to using the Google Cloud Console instead of the Firebase Console, the Cloud Console will show you the code for the currently-deployed function, so you can copy-paste it onto your local machine.

The Cloud Console also has a 'delete' button for every function, and even a web editor. Be aware when editing functions from the Cloud Console though: your next firebase deploy will overwrite any changes.

like image 60
Robert-Jan Huijsman Avatar answered Sep 23 '22 01:09

Robert-Jan Huijsman