tl; dr:您应该使用.gcloudignore
文件,而不是skip_files
中的文件app.yaml
。
而前两个答案
skip_files在
app.yaml文件中使用。现在
.gcloudignore使用
gclouddeploy或
upload命令创建一个。默认值取决于您使用的检测到的语言,但是会自动
.gcloudignore在我的Python项目中找到以下语言:
# This file specifies files that are *not* uploaded to Google Cloud Platform # 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# Python pycache:__pycache__/
注意 :当两个命令都
skip_files定义并且
.gcloudignore同时存在时,这些命令将不起作用。skip_files
definition oftheapp.yaml`参考中未提及此内容。
在
gcloud命令之间具有全球公认的标准似乎更好,并且
.gcloudignore与
skip_files仅在没有App
Engine时才有意义的相比,采用vs有意义。此外,它的工作原理很像
.gitignore参考文件中提到的文件:
.gcloudignore的语法大量来自.gitignore的语法;有关完整参考,请参见https://git-
scm.com/docs/gitignore或man gitignore。
https://cloud.google.com/sdk/gcloud/reference/topic/gcloudignore



