Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Does conform work without release? #138

Open
mbaeuerle opened this issue Aug 23, 2017 · 3 comments
Open

Does conform work without release? #138

mbaeuerle opened this issue Aug 23, 2017 · 3 comments

Comments

@mbaeuerle
Copy link

Is it possible to use conform like described in the docs when using mix phx.server (using phoenix) or iex -S mix or with mix test?

I tried iex and test but both didn't seem to work. In both cases the value from config.exs was used when fetching the property with Application.get_env().

So is this lib only intended to use in conjunction with destillery or can it also be used in development / testing environments without a release?

@madebyherzblut
Copy link

I like to know as well if there is a way to use conform outside of releases. To have a single way to configure our application would be nice!

@bobek bobek mentioned this issue Dec 10, 2017
@bobek
Copy link

bobek commented Dec 11, 2017

Let me share what I have found so far. Both Elixir as well as Ecto has implemented init callback. For example Ecto repo definition can now looks like:

defmodule MyApp.Repo do
  use Ecto.Repo, otp_app: :my_app
  def init(_, config) do
    {:ok, Keyword.put(config, :url, System.get_env("DATABASE_URL"))}
  end
end

So this could be on one of places, where one can extract app level configuration from conform and shove it back to appconfig. But to be honest, I am still not really sure, if this is the right approach.

Quite interesting thread at elixir-forum - https://elixirforum.com/t/always-use-releases/4573/18

@lswith
Copy link

lswith commented Mar 6, 2018

This is something I think should be put on the main documentation. It seems it doesn't say anywhere that conform doesn't work out of the box with mix run --no-halt.

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

No branches or pull requests

4 participants