Kokuou
Kokuou

Reputation: 139

Can Cloud Build deploy multiple Cloud Functions?

good day. I am new on GCP and wants to try Cloud Functions. I have a short experience in AWS Lambda.

My Problem: I am trying to find if it is possible for Cloud Build to deploy multiple Cloud Functions. In AWS, it has a SAM template were we could specify each lambda functions. Does GCP (or Cloud Build to be specific) also have support for this?

Upvotes: 1

Views: 421

Answers (1)

Pievis
Pievis

Reputation: 1994

Yes it is totally possible.

in gcp you deploy a cloud function with a cli tool called gcloud which is also available on cloud build, the command is basically this:

gcloud functions deploy NAME --runtime RUNTIME TRIGGER [FLAGS...]

in cloud build you just instruct the pipeline to use gcloud with those specific commands in order to deploy the functions you need, an example:

steps:
  - name: "gcr.io/cloud-builders/gcloud"
    args: ['functions ', 'deploy ', 'function1']
  - name: "gcr.io/cloud-builders/gcloud"
    args: ['functions ', 'deploy ', 'function2']
timeout: "1800s"

Upvotes: 3

Related Questions