conform icon indicating copy to clipboard operation
conform copied to clipboard

Does conform work without release?

Open mbaeuerle opened this issue 8 years ago • 3 comments

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?

mbaeuerle avatar Aug 23 '17 13:08 mbaeuerle

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!

madebyherzblut avatar Nov 10 '17 12:11 madebyherzblut

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

bobek avatar Dec 11 '17 08:12 bobek

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.

lswith avatar Mar 06 '18 02:03 lswith