gcloud 函数部署忽略点文件
gcloud functions deploy ignores dot-files
我的项目文件夹如下:
.
├── main.py
├── .keys
main.py 打开并阅读 .keys
的内容。
我将这个项目上传到 GCP Functions 如下:
gcloud functions deploy my-function --entry-point func --project my-project --runtime python37 --timeout 30 --trigger-topic my-topic
我的.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
当我这样做时,.keys
没有上传到我的 GCP 函数,因此代码无法从中读取。
如果.keys
也在您的.gitignore
中,gcloud
将不会上传。您需要从 .gcloudignore
中删除 #!include:.gitignore
或从 .gitignore
中删除 .keys
我的项目文件夹如下:
.
├── main.py
├── .keys
main.py 打开并阅读 .keys
的内容。
我将这个项目上传到 GCP Functions 如下:
gcloud functions deploy my-function --entry-point func --project my-project --runtime python37 --timeout 30 --trigger-topic my-topic
我的.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
当我这样做时,.keys
没有上传到我的 GCP 函数,因此代码无法从中读取。
如果.keys
也在您的.gitignore
中,gcloud
将不会上传。您需要从 .gcloudignore
中删除 #!include:.gitignore
或从 .gitignore
.keys