There are a number of ways to deploy Cloud Functions. We've already covered the one method: using the Cloud Console inline editor. This method is simple and straightforward, but it doesn't hold water in terms of release engineering. For real-world applications, there are a few better alternatives:
- Deploying from a GCS bucket
- Deploying from a local filesystem
- Deploying from a Google Cloud Source Repository
All three methods can be done using the gcloud beta functions deploy command. This command takes an optional --source argument, which accepts a GCS bucket path, a Cloud Source Repository, or a local filesystem path.