Deploying Google Cloud Functions (GCF)
Learn how to deploy and invoke a Google Cloud function using Serverless techniques.
We'll cover the following...
Deploying functions
We’ll need to change a few entries in the serverless.yml file. Specifically, we’ll set the region, the project, and the location of the credentials file. As we’ve seen in previous sections, we’ll use sed magic to replace those values.
We’re almost ready to deploy our function, but before we do that, we need to install the dependencies. For that, we’ll need npm, which, more often than not, is installed through Node.js.
Note: If you don’t already have
npm, please execute that command.
apt update && \
apt install nodejs npm
Now we can install the dependencies.
The output, limited to the relevant information, is as follows.
The processes added 48 dependencies, and we can proceed to deploy the function. ...