My project folder is as follows:
.
├── main.py
├── .keys
main.py opens and read the content of .keys
.
I upload this project to GCP Functions as follows:
gcloud functions deploy my-function --entry-point func --project my-project --runtime python37 --timeout 30 --trigger-topic my-topic
My .gcloudignore
is the default one:
# This file specifies files that are *not* uploaded to Google Cloud
# using gcloud. It follows the same syntax as .gitignore, with the addition of
# "#!include" directives (which insert the entries of the given .gitignore-style
# file at that point).
#
# For more information, run:
# $ gcloud topic gcloudignore
#
.gcloudignore
# If you would like to upload your .git directory, .gitignore file or files
# from your .gitignore file, remove the corresponding line
# below:
.git
.gitignore
node_modules
#!include:.gitignore
When I do this, .keys
is not uploaded to my GCP function and therefore the code fails to read from it.
If
.keys
is also in your.gitignore
,gcloud
will not upload it. You need to remove#!include:.gitignore
from your.gcloudignore
or remove.keys
from your.gitignore