Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploy Only Single Non-exported Function in Firebase Cloud Functions

I have created the following function in my the file of my firebase cloud functions:

function whatsMyName(name) {
  return "your name is " + name
} 

When I run the following in the command line, then the function is deployed:

firebase deploy --only functions

But, this deploys all of my functions. I would like to only deploy the whatsMyName function. Typically, if I have a function that is exported, like so:

exports.someExportedFunction = functions.https.onRequest((req, res) => {
   // do some stuff
}

Then I can run the following to deploy the exported function:

firebase deploy --only functions:someExportedFunction

However, when I run the following, the non-exported function is not deployed:

firebase deploy --only functions:whatsMyName

Does anyone understand why this doesn't individually deploy my non-exported function, whatsMyName, and how to deploy a non-exported function for Firebase Cloud Functions?

like image 794
Rbar Avatar asked Dec 18 '17 06:12

Rbar


1 Answers

The CLI can only individually deploy exported function triggers. It can not specifically deploy any arbitrary JavaScript named function.

In other words, what you're trying to do is not currently possible.

like image 162
Doug Stevenson Avatar answered Oct 06 '22 01:10

Doug Stevenson