Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Settings should maybe look in the current application's directory #51

Closed
andrewvy opened this issue Nov 13, 2018 · 2 comments
Closed

Settings should maybe look in the current application's directory #51

andrewvy opened this issue Nov 13, 2018 · 2 comments

Comments

@andrewvy
Copy link

This is more of an enhancement to help ease those who use Distillery, the problem is that the mappings in priv/elasticsearch won't match the right priv path when released into production, as something like:

indexes: %{
  albums: %{
    settings: "priv/elasticsearch/albums.json"
    # ...
  }
}

would not search in the currently running release directory.

I implemented a naive solution in andrewvy@b2bed7d which uses Application.app_dir/2 to get the running application's priv folder, but this loses the ability for those who may be pointing to paths outside of their application. Let me know if this is something worth adding! (Separate option, fallback lookup?)

@danielberkompas
Copy link
Owner

@andrewvy Thanks for this! Is there any reason you couldn't do the app dir lookup in the settings themselves? Something like this:

albums: %{
  settings: Application.app_dir(:my_app) <> "priv/elasticsearch/albums.json"
}

@andrewvy
Copy link
Author

Ah, the information is only correct at runtime. But I totally skipped over and realized I can just use Elasticsearch.Cluster.init/1 to provide runtime config anyways, making this a non-issue. :)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants