How do I specify a different "Executed Function" in my cloudbuild.yaml file than the name of the actual function name in GCP?
For example:
- I have a cloud function, written in python called
hello_world
- In my GCP deployment, I want to name the function
hello-world-dev
, andhello-world-prod
which is passed in the Triggers variables dynamically on build. - Build fails because it was expecting the function to be called
hello-world-dev
or whatever - I'm sure there's a flag to specify the executing function, but I haven't found it.
My cloudbuild.yaml
file looks like this:
#hello-world
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
args:
- gcloud
- functions
- deploy
- hello-world-${_ENV}
- --region=us-west2
- --source=./demo/hello-world/
- --trigger-http
- --runtime=python39
Steps I've Tried
I've tried the following flags:
--function
--call
--deploy
Looking at this documentation: https://cloud.google.com/functions/docs/deploying
The executed function is the function name in your code. By default, and it's your error, the executed function, if not specified, must be the same as the function name.
If your function name has a different name as the executed function, you need to specify the entrypoint of your function (the function to run in your code). Use the parameter
--entry-point=