首页 > 解决方案 > 'gcloud deploy' 抱怨同时拥有 .gcloudignore 和 skip_files,即使我两者都没有

问题描述

我正在尝试将 Django (v2.1) 应用程序部署到 App Engines Python37 运行时。这是我app.yaml的摘自谷歌示例

# [START django_app]
runtime: python37
#api_version: 1
#threadsafe: yes

handlers:
- url: /static
  static_dir: static/
- url: .*
  script: <project_name>.wsgi.application

# Only pure Python libraries can be vendored
# Python libraries that use C extensions can
# only be included if they are part of the App Engine SDK 
# Using Third Party Libraries: https://cloud.google.com/appengine/docs/python/tools/using-libraries-python-27
#libraries:
#- name: MySQLdb
#  version: 1.2.5
# [END django_app]

# Google App Engine limits application deployments to 10,000 uploaded files per
# version. The skip_files section allows us to skip virtual environment files
# to meet this requirement. The first 5 are the default regular expressions to
# skip, while the last one is for all env/ files.
#skip_files:
#- ^(.*/)?#.*#$
#- ^(.*/)?.*~$
#- ^(.*/)?.*\.py[co]$
#- ^(.*/)?.*/RCS/.*$
#- ^(.*/)?\..*$
#- ^env/.*$

除了最基本的设置外,所有设置都被注释掉了,并且.gcloudignorerepo 中没有文件。然而,当gcloud app deploy我收到以下错误消息时:

ERROR: (gcloud.app.deploy) You cannot use skip_files and have a .gcloudignore file in the same application. You should convert your skip_files patterns and put them in your .gcloudignore file. For information on the format and syntax of .gcloudignore files, see https://cloud.google.com/sdk/gcloud/reference/topic/gcloudignore.

我在某处读到 .glcoudignore 是在部署期间自动创建的,但即使这样也不应该是问题,因为我的 .glcoudignore 文件中skip_files没有app.yaml

有人可以告诉我我在这里做错了什么吗?

标签: google-app-enginegoogle-cloud-platformgcloudgoogle-app-engine-python

解决方案


Gcloud deploy 看到这#skip_files:条线,即使您已将其注释掉。删除该行,或更改其拼写。


推荐阅读