Reputation: 1987
I have created a Cloud Function called pupetter-e2e
with a trigger on changes to a bucket storage, called homepage. I want to deploy updates to the function with the following cloudbuild.yaml
:
steps:
- name: 'gcr.io/cloud-builders/gcloud'
args:
- functions
- deploy
- pupetter-e2e
- --source=.
- --trigger-bucket homepage
(trigger described: https://cloud.google.com/functions/docs/deploying/filesystem)
or alternatively:
steps:
- name: 'gcr.io/cloud-builders/gcloud'
args:
- functions
- deploy
- pupetter-e2e
- --source=.
- --trigger-resource hjemmeside
- --trigger-event google.storage.object.finalize
(as described as https://cloud.google.com/functions/docs/calling/storage) sadly, I get
ERROR: (gcloud.functions.deploy) unrecognized arguments: --trigger-bucket hjemmeside (did you mean '--trigger-bucket'?) or --trigger-resource hjemmeside (did you mean --trigger-resource?)
I have attempted to use --trigger-bucket
, but can not get it to work properly. Could someone please help me by correcting the mistake in my cloudbuild.yaml
?
Upvotes: 0
Views: 2496
Reputation: 75970
You have 2 solution to solve this (and even more, but 2 is already good). Firstly, Space aren't accepted in the args list, so:
steps:
- name: 'gcr.io/cloud-builders/gcloud'
args:
- functions
- deploy
- pupetter-e2e
- --source=.
- --trigger-bucket=homepage
steps:
- name: 'gcr.io/cloud-builders/gcloud'
args:
- functions
- deploy
- pupetter-e2e
- --source=.
- --trigger-bucket
- homepage
Upvotes: 1