在部署到App Engine期间不遵守Gcloudignore文件

Hen*_*äus 5 python google-app-engine google-cloud-platform gcloud

gcloud app deploy始终上传源目录中的所有文件,尽管我已使用.gcloudignore文件明确排除了它们。例如,虚拟环境文件夹env已上载,这会导致错误,因为部署中包含的文件超过了10,000个。

我正在Windows 10下使用Python 3.7和gcloud SDK 251.0.0。我尝试了beta和正常版本的gcloud app deploy

.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
  #!include:.gitignore
Run Code Online (Sandbox Code Playgroud)

我可以在带有--verbosity=info标志的输出中看到它识别出.gcloudignore文件,但是随后将env文件夹上传到Cloud Storage。我希望这个文件夹被跳过。Git按预期工作。

Dus*_*ram 4

您可以通过添加以下行将文件忽略的所有内容“包含”.gitignore在文件中:.gcloudignore

#!include:.gitignore
Run Code Online (Sandbox Code Playgroud)

如果您的.gitignore文件已经忽略该env目录,这也会导致gcloud忽略它(以及 git 忽略的所有其他文件)。