【问题标题】:“gcloud app deploy” static website is skiping too many files“gcloud app deploy”静态网站跳过了太多文件
【发布时间】:2017-06-27 10:56:10
【问题描述】:

我有一个静态网站,当我部署我的网站时,我正在使用 GAE,有些图片没有上传。 我该如何解决这个问题

控制台消息:

Some files were skipped. Pass `--verbosity=info` to see which ones. 
You may also view the gcloud log file, found at
[C:\Users\Maher\AppData\Roaming\gcloud\logs\2017.06.22\13.28.54.036000.log].

这是我的 app.yaml

runtime: php55
api_version: 1
threadsafe: true

handlers:
- url: /
  static_files: www/index.html
  upload: www/index.html

- url: /(.*)
  static_files: www/\1
  upload: www/(.*)

文件夹树:

>Website
  >www
    >css
    >fonts
    >img
      >photos
        pic_1.jpg
        pic_2.jpg 
        ...
    >js
    blog_post.html
    photos.html
    index.html
  app.yaml

【问题讨论】:

    标签: javascript html css google-app-engine


    【解决方案1】:

    将所有静态文件放在一个目录中,比如 assets -> css、fonts、img、js。 然后指定为静态目录

    - url: /assets
      static_dir: assets
      expiration: "1h"
      http_headers:
        Vary: Accept-Encoding
    

    【讨论】:

    • 您好@Supratim,感谢您的回复,但有些图片无法上传。
    • 嗨@MaherMahouachi,有些图片不能上传是什么意思?
    • 我有同样的信息一些文件被跳过了。部分图片和字体被跳过
    • @MaherMahouachi,可能你有很多文件。你可以做一件简单的事情。将文件上传到 google app engine storage(console.cloud.google.com/storage/browser) cdn 并公开,以便您访问。
    • 我认为我别无选择,我必须上传 GAE 存储中的所有图片而不是 js @Supratim
    猜你喜欢
    • 2018-06-25
    • 2017-07-16
    • 2019-05-18
    • 2020-10-11
    • 2020-07-21
    • 2017-04-16
    • 2018-03-08
    • 2018-11-12
    • 1970-01-01
    相关资源
    最近更新 更多