How to ignore files when running `gcloud app deploy`?

后端 未结 3 1471
执念已碎
执念已碎 2020-12-18 20:02

When I run

gcloud app deploy app.yaml

which files actually get uploaded?

The project folder contains folders and files such as

3条回答
  •  梦毁少年i
    2020-12-18 20:40

    EDIT Aug 2018: Google has since introduced .gcloudignore, which is now preferred, see dalanmiller's answer.


    They're all uploaded, unless you use the skip_files instruction in app.yaml. Files with a dot like .git are ignored by default. If you want to add more, beware that you're overriding these defaults and almost certainly want to keep them around.

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

    Note also that they are uploaded to different places if you use a static handler. Static files are sent to a CDN and are not available to your language run time (although there are ways around that, too).

    Make sure to read the docs:

    https://cloud.google.com/appengine/docs/standard/python/config/appref#skip_files

提交回复
热议问题