6
votes

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?

1

1 Answers

4
votes

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.