簡體   English   中英

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 function,因此代碼無法從中讀取。

如果.keys也在你的.gitignore中, gcloud將不會上傳它。 您需要從.gcloudignore中刪除#:include..gitignore或從.gitignore中刪除.keys

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM