[英]gcloud functions deploy ignores dot-files
My project folder is as follows:我的项目文件夹如下:
.
├── main.py
├── .keys
main.py opens and read the content of .keys
. main.py 打开并读取.keys
的内容。
I upload this project to GCP Functions as follows:我将这个项目上传到 GCP Functions,如下所示:
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:我的.gcloudignore
是默认的:
# 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.当我这样做时, .keys
没有上传到我的 GCP function,因此代码无法从中读取。
If .keys
is also in your .gitignore
, gcloud
will not upload it.如果.keys
也在你的.gitignore
中, gcloud
将不会上传它。 You need to remove #:include..gitignore
from your .gcloudignore
or remove .keys
from your .gitignore
您需要从.gcloudignore
中删除#:include..gitignore
或从.gitignore
中删除.keys
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.