简体   繁体   English

gcloud 函数部署忽略点文件

[英]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.

相关问题 gcloud 函数部署问题 - gcloud functions deploy issue 为什么 gcloud app deploy 将 0 个文件上传到谷歌云存储? - Why is gcloud app deploy uploading 0 files to google cloud storage? gcloud app deploy error too many files under.cache - gcloud app deploy error too many files under .cache gcloud app deploy:此部署文件过多 - gcloud app deploy : This deployment has too many files 错误:(gcloud.functions.deploy)消息=构建失败:function.js 不存在 - ERROR: (gcloud.functions.deploy) message=Build failed: function.js does not exist gcloud 函数部署 go 运行时错误“undefined: unsafe.Slice; Error ID: 2f5e35a0” - gcloud functions deploy go runtime error "undefined: unsafe.Slice; Error ID: 2f5e35a0" 如何修复错误:(gcloud.functions.deploy)PERMISSION_DENIED:权限'run.services.setIamPolicy'拒绝资源' - How to fix ERROR: (gcloud.functions.deploy) PERMISSION_DENIED: Permission 'run.services.setIamPolicy' denied on resource ' 错误:(gcloud.beta.functions.deploy)...消息=[调用者没有权限] - ERROR: (gcloud.beta.functions.deploy) ... message=[The caller does not have permission] 处理错误:(gcloud.functions.deploy) OperationError: code=3, message=Function failed on loading user code - Dealing with ERROR: (gcloud.functions.deploy) OperationError: code=3, message=Function failed on loading user code 如何将非功能更改/帮助文件部署到云功能? - How to deploy non-function changes / helper files to cloud functions?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM