Skip to content

Commit f934571

Browse files
authored
Merge pull request #2711 from ferd/carry-relx-overlay-vars
Properly carry overlay_vars settings for files in relx
2 parents e217913 + 5111f99 commit f934571

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/rebar_relx.erl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ do(Provider, State) ->
3636
DefaultOutputDir = filename:join(rebar_dir:base_dir(State), ?DEFAULT_RELEASE_DIR),
3737
RelxConfig1 = RelxMode ++ [output_dir(DefaultOutputDir, Opts),
3838
{overlay_vars_values, ExtraOverlays},
39-
{overlay_vars, [{base_dir, rebar_dir:base_dir(State)} | overlay_vars(Opts)]}
39+
{overlay_vars, [{base_dir, rebar_dir:base_dir(State)} | overlay_vars(RelxConfig, Opts)]}
4040
| merge_overlays(RelxConfig)],
4141

4242
Args = [include_erts, system_libs, vm_args, sys_config],
@@ -219,10 +219,9 @@ merge_overlays(Config) ->
219219
NewOverlay = lists:flatmap(fun({overlay, Overlay}) -> Overlay end, lists:reverse(Overlays)),
220220
[{overlay, NewOverlay} | Others].
221221

222-
overlay_vars(Opts) ->
223-
case proplists:get_value(overlay_vars, Opts) of
224-
undefined ->
225-
[];
222+
overlay_vars(RelxConfig, Opts) ->
223+
case proplists:get_value(overlay_vars, Opts, []) ++
224+
proplists:get_value(overlay_vars, RelxConfig, []) of
226225
[] ->
227226
[];
228227
FileName when is_list(FileName) ->

test/rebar_release_SUITE.erl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,15 +242,14 @@ profile_overlays(Config) ->
242242
{copy, filename:join(AppDir,"./dev.file"), "{{env}}.file"},
243243
{chmod, 8#00770, "profile.file"}]},
244244
{lib_dirs, [AppDir]}]},
245-
{profiles, [{prod,
245+
{profiles, [{prod,
246246
[{relx, [
247247
{debug_info, keep},
248248
{overlay_vars, filename:join(AppDir, "prod.vars")},
249249
{overlay, [{mkdir, "otherrandomdir"},
250250
{copy, filename:join(AppDir, "./prod.file"), "{{env}}.file"},
251251
{copy, filename:join(AppDir, "./prod.file"), "profile.file"},
252252
{chmod, 8#00770, "profile.file"}]}
253-
254253
]}]
255254
}]}
256255
])),

0 commit comments

Comments
 (0)