When deploying a simple hello_world app to Google Cloud Functions using gcloud, I get the following error message:
ERROR: (gcloud.functions.deploy) OperationError: code=3, message=Build failed: Build error details not available
It took me quite a while to figure out that this is due to my .cloudignore file:
.cloudignore
# Ignore everything
*
# Except these files:
!main.py
!requirements.txt
What seems to be the problem with this file? And what is a better way achieve what I want, i.e. ignore all files except main.py and requirements.txt?
Any hints are greatly appreciated!
It seems that there's a bug with
gcloud functions
handling of.gitignore
;gcloud app
andgcloud meta list-files-for-upload
don't suffer from the same problem, handling the!
rules correctly.A workaround proposed in this answer to a similar question works for me, explicitly include the
.
directory e.g. add a rule like this.