Deploying from a local machine

When deploying from a local filesystem, gcloud will first bundle the included files and push them to a staging bucket in GCS. The staging bucket to use can be specified by providing the optional --stage-bucket argument. Once in the staging bucket, the process for deployment is similar to that of deploying directly from a GCS bucket.

To test deploying a Cloud Function from a local filesystem, navigate to the source code for example 1 of this chapter at chapter_06/example_01 and run the following command:

gcloud beta functions deploy example01 --trigger-http --entry-point=helloGET

Note that this command doesn't use the optional --source flag. When the --source flag is not provided, gcloud will default to using the current directory.