Skip to content

Commit

Permalink
Include odbc app in release only when required (#3633)
Browse files Browse the repository at this point in the history
  • Loading branch information
badlop committed Jun 27, 2021
1 parent b5b2ad5 commit 774de2b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
{"stringprep", []}]}.

{relx, [{release, {ejabberd, {cmd, "grep {vsn, vars.config | sed 's|{vsn, \"||;s|\"}.||' | tr -d '\012'"}},
[ejabberd, odbc]},
[ejabberd]},
{sys_config, "./rel/sys.config"},
{vm_args, "./rel/vm.args"},
{overlay_vars, "vars.config"},
Expand Down
13 changes: 12 additions & 1 deletion rebar.config.script
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,17 @@ fun(Deps, FDeps) ->
end, Deps)
end,


VarsApps = case file:consult(filename:join([filename:dirname(SCRIPT),"vars.config"])) of
{ok, TermsV} ->
case proplists:get_bool(odbc, TermsV) of
true -> [odbc];
false -> []
end;
_->
[]
end,

ProcessRelx = fun(Relx, Deps) ->
{value, {release, NameVersion, DefaultApps}, RelxTail} = lists:keytake(release, 1, Relx),
ProfileApps = case os:getenv("REBAR_PROFILE") of
Expand All @@ -348,7 +359,7 @@ ProcessRelx = fun(Relx, Deps) ->
DepApps = lists:map(fun({DepName, _, _}) -> DepName;
({DepName, _}) -> DepName
end, Deps),
[{release, NameVersion, DefaultApps ++ ProfileApps ++ DepApps} | RelxTail]
[{release, NameVersion, DefaultApps ++ VarsApps ++ ProfileApps ++ DepApps} | RelxTail]
end,

GithubConfig = case {os:getenv("GITHUB_ACTIONS"), os:getenv("GITHUB_TOKEN")} of
Expand Down

0 comments on commit 774de2b

Please sign in to comment.