I am trying to deploy a simple function in Cloud Builds through a yaml file. This function lives in Github and the Cloud Build trigger point at my repository in order to deploy it. Cloud Build invokes my yaml file without problems but suddenly I get this error
ERROR: (gcloud.functions.deploy) OperationError: code=3, message=Build failed: function.js does not exist; Error ID: 7485c5b6
I am not sure why gcloud function deploy is looking for a function.js file when as far as I understand, it just searches for the index.js file. The files that I have are:
The function deploys successfully through gcloud cli so my bet is that the error exists in the yaml file but it might also be some config in Cloud Build. Here how yaml file looks:
steps:
- name: "gcr.io/cloud-builders/gcloud"
args:
- functions
- deploy
- webhook
- --source=.
- --trigger-http
- --runtime=nodejs12
- --region=europe-west2
- --allow-unauthenticated
Have somebody any clue of what could be happening? thanks!
The error have been solved installing npm. Adding this to yaml file:
steps:
- name: "gcr.io/cloud-builders/npm"
args: ["install"]
dir: "YOUR_PATH"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With