Ayyappa
Ayyappa

Reputation: 1984

Auto detecting available cloud functions to deploy when using gcloud cli

Firebase tools auto detects the available functions and deploy when we issue the below command

firebase deploy --only functions

But, we would like to use gcloud cli as it has more control for providing environment variables/for specifying a vpc connector.

Unfortunately, when using gcloud functions deploy, we need to specify the function name for each function.

Is it possible to get the list of http functions/triggers automatically from the source?

Update : As gcloud cli needs the type of the function (http/event), how to find out the type of the exported function automatically so that i can automate instead of specifying each function details?

Upvotes: 0

Views: 37

Answers (1)

Doug Stevenson
Doug Stevenson

Reputation: 317758

If you are working with source code meant to be deployed to Cloud Functions by the Firebase CLI, you can write code to:

  1. Load (require()) the module defined by index.js
  2. Iterate its exports - each export is expected to be a function to deploy

There is nothing existing that will do this for you - you will have to write the code.

Upvotes: 0

Related Questions