Skip to content

Commit

Permalink
Do not copy kiss_disco.txt into reg1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
arcusfelis committed Mar 6, 2022
1 parent 8add6ca commit 41994e5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ejabberd_ctl.erl
Original file line number Diff line number Diff line change
Expand Up @@ -940,4 +940,4 @@ kiss_info(Tables) ->
[kiss_table_info(Table) || Table <- Tables].

kiss_table_info(#{memory := Memory, size := Size, nodes := Nodes, table := Tab}) ->
?PRINT("table=~0p size=~p memory=~0p words nodes=~0p~n", [Tab, Size, Memory, Nodes]).
?PRINT("table=~0p size=~p memory_words=~0p nodes=~0p~n", [Tab, Size, Memory, Nodes]).
1 change: 1 addition & 0 deletions tools/build-releases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ function try_copy_release
--exclude rel/mongooseim/Mnesia.* \
--exclude rel/mongooseim/var \
--exclude rel/mongooseim/log \
--exclude rel/mongooseim/etc/kiss_disco.txt \
-al _build/$FIRST_NODE/ _build/$NODE/
./tools/test_runner/apply_templates.sh "$NODE" "$(pwd)/_build/$NODE/"
fi
Expand Down
15 changes: 12 additions & 3 deletions tools/test_runner/apply_templates.erl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ main([NodeAtom, BuildDirAtom]) ->
log("BuildDirAtom=~p~n", [BuildDirAtom]),
BuildDir = atom_to_list(BuildDirAtom),
RelDir = BuildDir ++ "/rel/mongooseim",
Templates = templates(RelDir),
Templates = templates(RelDir, BuildDirAtom),
log("Templates:~n~p~n", [Templates]),
Vars0 = overlay_vars(NodeAtom),
Vars = Vars0#{output_dir => list_to_binary(RelDir)},
Expand All @@ -36,8 +36,9 @@ consult_map(File) ->
maps:from_list(Vars).

%% Based on rebar.config overlay section
templates(RelDir) ->
simple_templates(RelDir) ++ erts_templates(RelDir).
templates(RelDir, BuildDirAtom) ->
simple_templates(RelDir) ++ erts_templates(RelDir)
++ disco_template(RelDir, BuildDirAtom).

simple_templates(RelDir) ->
[{In, RelDir ++ "/" ++ Out} || {In, Out} <- simple_templates()].
Expand All @@ -57,6 +58,14 @@ erts_templates(RelDir) ->
ErtsDirs = filelib:wildcard(RelDir ++ "/erts-*"),
[{"rel/files/nodetool", ErtsDir ++ "/bin/nodetool"} || ErtsDir <- ErtsDirs].

disco_template(RelDir, BuildDirAtom) ->
case lists:member(BuildDirAtom, [mim1, mim2, mim3]) of
true ->
[{"rel/files/kiss_disco.txt", RelDir ++ "/etc/kiss_disco.txt"}];
false ->
[]
end.

render_template(In, Out, Vars) ->
BinIn = bbmustache:parse_file(In),
%% Do render twice to allow templates in variables
Expand Down

0 comments on commit 41994e5

Please sign in to comment.