The release does not see my config file defined in rebar.config

I am trying to pass a config file when i run my release but when i run my release the config file values are not there:
I have tried in the rebar.config with both config and config_src , but no matter what i do , the keys belonging to my config file will not get read.

rebar.config (profile prod1)

{profiles,[ {prod1,[ {relx,[{mode,prod}, {system_libs,false}, {config_src,"./config/prod.sys.config.src"}, {vm_args_src,"./config/vm.args.src"}]} ]} ]}.
I am testing after running my release to see if config file was used by using
application:get_env([appname],[appkey])
The repo:

Important
To run the app , i have a shell script in the root called relscript1.sh which will create the release and then run it.

2 Likes

I’m not too familiar with rebar since I generally prefer erlang.mk, but I guess the issue is related to your use of relative paths (./...) in config_src and vm_args_src. Maybe try with an absolute path, see if that works, and if yes work from there.

2 Likes

Well as you can see (if you checked my repo) i am also using a vm.args.src file that is also defined as a relative path. That one works and all of its contents get parsed correctly. Why would this one differ ? The two files are actually in the same folder config.

2 Likes

TBH, I didn’t :sweat_smile:

But a quick stab at Google revealed this, which says that it’s sys_config_src, not config_src. Could that be it?

3 Likes

Ok so i have corrected that typo and now the name is sys_config_src.

I have checked this with Tristan and he is on Linux and apparently it works for him.

I am on WSL and it seems that the config file at the path from rebar config is nout found and it falls back to a default one with the empty value [ ] . Could this be a WSL specific problem ?

1 Like

Hm, I don’t know, I’m on Linux too so can’t even check. But I see in your Repo that you were able to fix it by using an absolute path. That’s strange, though, and I’m pretty sure that this is not how it’s supposed to be. Maybe you should raise an issue at the rebar3 repo about it, if there isn’t one already.

2 Likes

Apparently the problem was not the path but something totally different , the command was invalid and the profile was ignored; for more here ( i posted it on rebar3 repo)

3 Likes

I see :sweat_smile:

2 Likes