将Symfony项目部署到App Engine-错误:文件过多 [英] Deploy Symfony project to App Engine - ERROR: Too many files

查看:69
本文介绍了将Symfony项目部署到App Engine-错误:文件过多的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

第一次将Symfony项目部署到Google App Engine,运行gcloud app deploy.

First time deploying a Symfony project to Google App Engine, ran gcloud app deploy.

错误:

File upload done.
ERROR: (gcloud.app.deploy) INVALID_ARGUMENT: This deployment has too many files. New versions are limited to 10000 files for this app.
- '@type': type.googleapis.com/google.rpc.BadRequest
  fieldViolations:
  - description: This deployment has too many files. New versions are limited to 10000
      files for this app.
    field: version.deployment.files[...]

我怀疑问题是我的app.yaml文件:

I suspect the problem is my app.yaml file:

runtime: php55
api_version: 1

handlers:
# tell appengine where our static assets live
- url: /public
  static_dir: public

(我想我至少缺少一些东西要告诉它不要上传供应商的东西,例如忽略).

(I think I'm at least missing something to tell it not to upload the vendor stuff eg. ignore).

我应该如何更新我的app.ymal文件以进行项目部署?

PS Project文件夹如下所示:

PS Project folders shown below:

推荐答案

对于

Increase the deployment verbosity using the --verbosity option for the gcloud app deploy command and you'll get the list of all the files uploaded. Then use the skip_files option in your app.yaml to specify the ones you want ignored:

可选. skip_files 元素可指定 应用程序目录不得上传到App Engine.价值 是正则表达式或正则表达式列表.任何 匹配任何正则表达式的文件名将从 上载应用程序时要上载的文件列表. 文件名是相对于项目目录的.

Optional. The skip_files element specifies which files in the application directory are not to be uploaded to App Engine. The value is either a regular expression, or a list of regular expressions. Any filename that matches any of the regular expressions is omitted from the list of files to upload when the application is uploaded. Filenames are relative to the project directory.

skip_files 具有以下默认值:

skip_files:
- ^(.*/)?#.*#$
- ^(.*/)?.*~$
- ^(.*/)?.*\.py[co]$
- ^(.*/)?.*/RCS/.*$
- ^(.*/)?\..*$

注意:请注意覆盖此配置的默认值.

Note: watch out for overwriting the defaults for this config.

我可能是错的,但是您的项目结构图像表明您的应用程序代码位于src目录中.如果是这样,我建议将其中的app.yaml文件移动到其中-包含正在部署的app.yaml文件的目录被认为是该应用程序/服务的顶级目录-其所有内容都将上传到GAE.这样移动后,您可能需要调整一些路径-GAE会考虑与此应用程序/服务顶层目录相关的所有应用程序/服务路径.如果需要它们,可以有选择地将项目目录中的某些文件/目录符号链接到src目录中,部署遵循符号链接,将其替换为实际内容.

I may be wrong, but your project structure image suggests your app code resides in the src directory. If so I'd suggest moving the app.yaml file inside it - the directory containing the app.yaml file being deployed is considered to be the top dir of the app/service - its entire content will be uploaded to GAE. You may need to adjust some paths after such move - GAE considers all app/service paths relative to this app/service top dir. If you need them, you can selectively symlink some files/directories from the project directory into the src dir, deployment follows symlinks, replacing them with their actual content.

一些相关帖子:

  • How to properly deploy node apps to GAE with secret keys?
  • gcloud app deploy : This deployment has too many files

这篇关于将Symfony项目部署到App Engine-错误:文件过多的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆