Appengine应用部署未上传某些文件夹 [英] Appengine app deployment is not uploading some folders

查看:88
本文介绍了Appengine应用部署未上传某些文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在AppEngine上部署了一个应用程序. 当我在本地测试应用程序时,一切正常. 我已经完成composer的安装,并且"vendor"文件夹存在.

I have an app deployed on AppEngine. When I test the app locally, everything works fine. I have done composer install and the "vendor" folder exists.

当我查看源代码时,我可以看到某些文件夹没有上载. 这是我在本地驱动器上的文件夹结构:

When I view the source, i can see that some folders are not uploading. This is my folder structure on local drive:

我使用以下代码进行部署:

I deploy using this code:

gcloud app deploy --promote --stop-previous-version app.yaml

已部署的结构如下:

如您所见,仅上载了dialpad_research文件夹. 我的app.yaml文件是这样的:

As you can see, only dialpad_research folder is uploaded. My app.yaml file is like this:

runtime: php55
api_version: 1
threadsafe: true

env_variables:

handlers:
- url: /(.*\.(appcache|manifest))
  mime_type: text/cache-manifest
  static_files: static/\1
  upload: static/(.*\.(appcache|manifest))

- url: /dialpad_research/(.*\.(appcache|manifest))
  mime_type: text/cache-manifest
  static_files: dialpad_research/static/\1
  upload: dialpad_research/static/(.*\.(appcache|manifest))

- url: /(.*\.atom)
  mime_type: application/atom+xml
  static_files: static/\1
  upload: static/(.*\.atom)

- url: /(.*\.crx)
  mime_type: application/x-chrome-extension
  static_files: static/\1
  upload: static/(.*\.crx)

- url: /(.*\.css)
  mime_type: text/css
  static_files: static/\1
  upload: static/(.*\.css)

- url: /(.*\.eot)
  mime_type: application/vnd.ms-fontobject
  static_files: static/\1
  upload: static/(.*\.eot)

- url: /(.*\.htc)
  mime_type: text/x-component
  static_files: static/\1
  upload: static/(.*\.htc)

- url: /(.*\.html)
  mime_type: text/html
  static_files: static/\1
  upload: static/(.*\.html)

- url: /(.*\.ico)
  mime_type: image/x-icon
  static_files: static/\1
  upload: static/(.*\.ico)

- url: /(.*\.js)
  mime_type: text/javascript
  static_files: static/\1
  upload: static/(.*\.js)

- url: /(.*\.json)
  mime_type: application/json
  static_files: static/\1
  upload: static/(.*\.json)

- url: /(.*\.otf)
  mime_type: font/opentype
  static_files: static/\1
  upload: static/(.*\.otf)

- url: /(.*\.rss)
  mime_type: application/rss+xml
  static_files: static/\1
  upload: static/(.*\.rss)

- url: /(.*\.safariextz)
  mime_type: application/octet-stream
  static_files: static/\1
  upload: static/(.*\.safariextz)

- url: /(.*\.(svg|svgz))
  mime_type: images/svg+xml
  static_files: static/\1
  upload: static/(.*\.(svg|svgz))

- url: /(.*\.swf)
  mime_type: application/x-shockwave-flash
  static_files: static/\1
  upload: static/(.*\.swf)

- url: /(.*\.ttf)
  mime_type: font/truetype
  static_files: static/\1
  upload: static/(.*\.ttf)

- url: /(.*\.txt)
  mime_type: text/plain
  static_files: static/\1
  upload: static/(.*\.txt)

- url: /(.*\.unity3d)
  mime_type: application/vnd.unity
  static_files: static/\1
  upload: static/(.*\.unity3d)

- url: /(.*\.webm)
  mime_type: video/webm
  static_files: static/\1
  upload: static/(.*\.webm)

- url: /(.*\.webp)
  mime_type: image/webp
  static_files: static/\1
  upload: static/(.*\.webp)

- url: /(.*\.woff)
  mime_type: application/x-font-woff
  static_files: static/\1
  upload: static/(.*\.woff)

- url: /(.*\.xml)
  mime_type: application/xml
  static_files: static/\1
  upload: static/(.*\.xml)

- url: /(.*\.xpi)
  mime_type: application/x-xpinstall
  static_files: static/\1
  upload: static/(.*\.xpi)

# audio files
- url: /(.*\.(mid|midi|mp3|wav))
  static_files: static/\1
  upload: static/(.*\.(mid|midi|mp3|wav))

# windows files
- url: /(.*\.(doc|exe|ppt|rtf|xls))
  static_files: static/\1
  upload: static/(.*\.(doc|exe|ppt|rtf|xls))

# compressed files
- url: /(.*\.(bz2|gz|rar|tar|tgz|zip))
  static_files: static/\1
  upload: static/(.*\.(bz2|gz|rar|tar|tgz|zip))

# index files
- url: /(.*)/
  static_files: static/\1/index.html
  upload: static/(.*)/index.html

- url: /dialpad_research/api/(.+\.php)$
  script: dialpad_research/api/\1

- url: /vendor/(.+\.php)$
  script: vendor/\1

# site root
- url: /
  static_files: static/index.html
  upload: static/index.html


- url: /static
  static_dir: static


- url: /dialpad_research/static
  static_dir: dialpad_research/static

# dialpad root
- url: /dialpad_research.*
  static_files: dialpad_research/static/index.html
  upload: dialpad_research/static/index.html

# portfolio redirect
- url: /portfolio/.*
  static_files: static/red.html
  upload: static/red.html

# G2 redirect
- url: /g2.*
  static_files: static/red.html
  upload: static/red.html

# Blog redirect
- url: /blog.*
  static_files: static/red.html
  upload: static/red.html

# SSDESIGN redirect
- url: /ssdesign.*
  static_files: static/red.html
  upload: static/red.html

# Colours redirect
- url: /colours.*
  static_files: static/red.html
  upload: static/red.html

你知道我在这里做错什么吗?

Any idea what I might be doing wrong here?

谢谢

推荐答案

由于GAE是通过static_dir处理程序处理的,因此预计GAE上将缺少static目录,因此默认情况下不会与应用程序代码一起上传.如果要将其与应用程序代码一起上传,则需要为其设置application_readable.来自处理程序元素:

The static directory is expected to be missing on GAE because it's handled via a static_dir handler, so by default it's not uploaded together with the app code. If you want it uploaded together with the app code you need to set the application_readable for it. From Handlers element:

应用可读

可选.布尔值.默认情况下,在静态文件处理程序中声明的文件 作为静态数据上传,并且仅提供给最终用户.他们 应用程序无法读取.如果此字段设置为true,则 文件也作为代码数据上传,因此您的应用程序可以读取 他们.两次上传均会根据您的代码和静态数据收费 存储资源配额.

Optional. Boolean. By default, files declared in static file handlers are uploaded as static data and are only served to end users. They cannot be read by an application. If this field is set to true, the files are also uploaded as code data so your application can read them. Both uploads are charged against your code and static data storage resource quotas.

这同样适用于通过static_file处理程序提供的所有单个文件.

The same applies to all individual files served via static_file handlers.

vendor目录的内容有所不同-没有静态文件/目录引用它.

Things are different for the vendor directory - no static file/dir references it.

我尚无法从您帖子的信息中看到未上传vendor的原因.您可以尝试的事情:

I can't yet see a reason for vendor not being uploaded from the info from your post. Things you can try:

  • 使用--verbosity .gcloudignore文件检查其内容
  • 使用不同于vendor的目录名-以防万一由于某种原因而对特定名称进行了不同处理的情况-只是一个大胆的猜测,以防因增加的冗长而无法找到跳过目录的原因
  • increase the verbosity of your deployment command using the --verbosity global option, it should mention which files/directories are being skipped and why.
  • if you have a .gcloudignore file in your service check its content
  • use a directory name different than vendor - just in case that particular name is handled differently for whatever reason - just a wild guess, in case the reason for skipping the directory isn't uncovered by the increased verbosity

这篇关于Appengine应用部署未上传某些文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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