teracyhq-incubator / teracy-dev-core

teracy-dev-core extension
MIT License
1 stars 6 forks source link

should add extension path variables dynamically #35

Closed hoatle closed 6 years ago

hoatle commented 6 years ago

so that extension configs should have the right path, for example, chef cookbooks_path for https://github.com/teracyhq-incubator/teracy-dev-v05-compat/pull/2/files

We should have <extension-name>-path variable so that, only enabled extensions will have the associated <extension-name>-path, the path should not include slash character (/) at the end.

      cookbooks_path:
        - teracy-dev-v05-compat/vendor-cookbooks
        - teracy-dev-v05-compat/main-cookbooks

should become:

      cookbooks_path:
        - "%{teracy-dev-v05-compat-path}/vendor-cookbooks"
        - "%{teracy-dev-v05-compat-path}/main-cookbooks"

By supporting this, https://github.com/teracyhq-incubator/teracy-dev-v05-compat/pull/2 will not have to create a new configurator but using yaml config only.

hoatle commented 6 years ago

assigned to @phuonglm to handle this for the related PR.

hoatle commented 6 years ago

you can create: processors/extension_path.rb to work on this and register this processor before the variables.rb processor then it should work.

hoatle commented 6 years ago

settings['variables'] should be updated to include these dynamic vars

hoatle commented 6 years ago

related: https://github.com/teracyhq/dev/issues/497

If the above improvement is done, we can implement the feature of this issue on any extensions instead of waiting for teracy-dev-core.

hoatle commented 6 years ago

this should be done quickly, I guess it should not take more than 2 hours.

hoatle commented 6 years ago
extension_path = File.join(extension['path']['lookup'] || TeracyDev::DEFAULT_EXTENSION_LOOKUP_PATH,  extension['path']['extension'])

You can use Util.extension_lookup_path if suitable for the lookup_path

hoatle commented 6 years ago

this can be postponed, we don't have to rush for this, so assigned to @hieptranquoc for the next sprint instead.

hoatle commented 6 years ago

this cannot be postponed, required for https://github.com/teracyhq-incubator/teracy-dev-v05-compat/issues/1