cmo

cmo

Loading an umbrella app's own runtime.exs in dev

Given an umbrella application with applications that define their own runtime.exs files in apps/appname/config/runtime.exs. The app specific config files are added to the releases using Config Providers. Is it possible to also load those app-specific runtime.exs files in development? Can I pass an arg to iex -S mix or something?

First Post!

byu

byu

Given an umbrella application with applications that define their own runtime.exs files in apps/appname/config/runtime.exs

Context:

When I created my own umbrella project, (e.g. mix phx.new --umbrella) , the directory structure ended up something like the following.

my_app_umbrella
├── README.md
├── apps
│   ├── my_app
│   └── my_app_web
├── config
│   ├── config.exs
│   ├── dev.exs
│   ├── prod.exs
│   ├── runtime.exs
│   └── test.exs
└── mix.exs

And trying any sort of import_config inside config/runtime.exs looks to be forbidden

import_config "../apps/my_app/config/runtime.exs"

or if I have config/my_app/runtime.exs closer to the config files in the umbrella app itself:

import_config "my_app/config/runtime.exs"
% iex -S mix                          
** (RuntimeError) import_config/1 is not enabled for this configuration file. Some configuration files do not allow importing other files as they are often copied to external systems
    (elixir 1.16.2) lib/config.ex:312: Config.import_config!/3
    /Users/ben/my_app_umbrella/config/runtime.exs:112: (file)
    (stdlib 5.2) erl_eval.erl:750: :erl_eval.do_apply/7
    (stdlib 5.2) erl_eval.erl:136: :erl_eval.exprs/6
    (elixir 1.16.2) lib/code.ex:572: Code.validated_eval_string/3

I had assumed that for umbrella applications, the way it does releases, to place all config in this runtime.exs.

The app specific config files are added to the releases using Config Providers.

Can you provide some additional context about how your Config Providers work?

Where Next?

Popular in Questions Top

dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
pgiesin
This should be a simple problem but I just can’t seem to figure it out. I have a standalone Elixir app that won’t find the database. Dep...
New
logicmason
Hi there, I'm working through my first release with elixir/phoenix. I've built a release with distillery and found that it crashes when I...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
LegitStack
I’m trying to make a websocket server in Phoenix or raw Elixir. I heard about gun, I think I could use cowboy, but since I’m not that sma...
New
Codball
Mix format works fine if run from the cmd. I’ve followed this to facilitate the implementation into VSC which involves downloading an ext...
New
Mooodi
Given a string, how can I get access to its character by index? Enum.at("my_string", 2) doesn't work. Or rather, not char, but a substr...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New

Other popular topics Top

senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 45766 226
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> someth...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New

We're in Beta

About us Mission Statement