Do I need to copy `skip_files` across multiple YAML files?

后端 未结 1 429
攒了一身酷
攒了一身酷 2020-12-12 01:57

I\'m still rather ignorant of the appengine module deployment process. My app has three modules that I update and deploy independently.

I just noticed that while I

相关标签:
1条回答
  • 2020-12-12 02:53

    GAE treats each module as a separate, standalone app, each running in its own instance. No app uploadable artifacts are shared at the GAE infra level between the modules. For that reasons it's even possible to mix modules written in different languages, if I understand correctly.

    In the DRY spirit app's files or directories can be "shared" between modules at the source code level by symlinking a single source copy of the file/dir into all the modules. When the app is deployed into GAE the deployment utility replaces to the symlinks with the actual symlink target content.

    The symlinking method however is not applicable to sharing below the file level, like just sections in a file. DRY can still be applied to some select sections of config files explicitly supported by the GAE infra.

    The skip_files section happens to be one of such supported sections, according to the documentation:

    The includes directive allows you to include the configuration file for any library or module throughout your application. For example, you might include a user administration library as follows:

    includes:
    - lib/user_admin.yaml
    

    ...and...

    Using includes retrieves only the following types of directives from the destination file (if present):

    • builtins
    • includes
    • handlers
    • skip_files

    Based on this I think you could have an app_shared.yaml file in your app's top level dir, containing your skip_files patterns (careful with overriding the defaults, BTW) which you could then be included in your modules' .yaml files:

    includes:
    - app_shared.yaml
    

    You may need to symlink app_shared.yaml into each of the module's dir (the above DRY method) if that's where the modules' .yaml files exist as suggested in the Modules Doc.

    Note: I didn't actually use the inclusion method myself, the answer is based purely on the documentation.

    0 讨论(0)
提交回复
热议问题