build: work with new emqx app location
This commit is contained in:
parent
1715b87dce
commit
c573474ec6
|
@ -351,7 +351,7 @@ etc_overlay(ReleaseType) ->
|
|||
[community_plugin_etc_overlays(App) || App <- relx_plugin_apps_extra()],
|
||||
[ {mkdir, "etc/"}
|
||||
, {mkdir, "etc/plugins"}
|
||||
, {template, "etc/BUILT_ON", "releases/{{release_version}}/BUILT_ON"}
|
||||
, {template, "{{base_dir}}/lib/emqx/etc/BUILT_ON", "releases/{{release_version}}/BUILT_ON"}
|
||||
, {copy, "{{base_dir}}/lib/emqx/etc/certs","etc/"}
|
||||
] ++
|
||||
lists:map(
|
||||
|
@ -368,18 +368,20 @@ extra_overlay(edge) ->
|
|||
[].
|
||||
emqx_etc_overlay(cloud) ->
|
||||
emqx_etc_overlay_common() ++
|
||||
[ {"etc/emqx_cloud/vm.args","etc/vm.args"}
|
||||
[ {"{{base_dir}}/lib/emqx/etc/emqx_cloud/vm.args","etc/vm.args"}
|
||||
];
|
||||
emqx_etc_overlay(edge) ->
|
||||
emqx_etc_overlay_common() ++
|
||||
[ {"etc/emqx_edge/vm.args","etc/vm.args"}
|
||||
[ {"{{base_dir}}/lib/emqx/etc/emqx_edge/vm.args","etc/vm.args"}
|
||||
].
|
||||
|
||||
emqx_etc_overlay_common() ->
|
||||
["etc/acl.conf", "etc/emqx.conf", "etc/ssl_dist.conf",
|
||||
[{"{{base_dir}}/lib/emqx/etc/acl.conf", "etc/acl.conf"},
|
||||
{"{{base_dir}}/lib/emqx/etc/emqx.conf", "etc/emqx.conf"},
|
||||
{"{{base_dir}}/lib/emqx/etc/ssl_dist.conf", "etc/ssl_dist.conf"},
|
||||
%% TODO: check why it has to end with .paho
|
||||
%% and why it is put to etc/plugins dir
|
||||
{"etc/acl.conf.paho", "etc/plugins/acl.conf.paho"}].
|
||||
{"{{base_dir}}/lib/emqx/etc/acl.conf.paho", "etc/plugins/acl.conf.paho"}].
|
||||
|
||||
plugin_etc_overlays(App0) ->
|
||||
App = atom_to_list(App0),
|
||||
|
|
|
@ -10,9 +10,6 @@ find_app() {
|
|||
find "${appdir}" -mindepth 1 -maxdepth 1 -type d
|
||||
}
|
||||
|
||||
# append emqx application first
|
||||
echo 'emqx'
|
||||
|
||||
find_app 'apps'
|
||||
if [ -f 'EMQX_ENTERPRISE' ]; then
|
||||
find_app 'lib-ee'
|
||||
|
|
|
@ -8,8 +8,5 @@ set -euo pipefail
|
|||
# ensure dir
|
||||
cd -P -- "$(dirname -- "$0")/.."
|
||||
|
||||
TESTDIR="test"
|
||||
if [ "$1" != "emqx" ]; then
|
||||
TESTDIR="$1/test"
|
||||
fi
|
||||
TESTDIR="$1/test"
|
||||
find "${TESTDIR}" -name "*_SUITE.erl" 2>/dev/null | xargs | tr ' ' ','
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
-define(BASE, <<"emqx">>).
|
||||
|
||||
main(_) ->
|
||||
{ok, Bin} = file:read_file("etc/emqx.conf"),
|
||||
{ok, Bin} = file:read_file(conf_file()),
|
||||
Lines = binary:split(Bin, <<"\n">>, [global]),
|
||||
Sections0 = parse_sections(Lines),
|
||||
{value, _, Sections1} = lists:keytake(<<"modules">>, 1, Sections0),
|
||||
|
@ -24,6 +24,10 @@ main(_) ->
|
|||
end, IncludeNames),
|
||||
ok = dump_sections([{N, Base ++ Includes}| Sections2]).
|
||||
|
||||
etc_dir() -> filename:join(["apps", "emqx", "etc"]).
|
||||
|
||||
conf_file() -> filename:join([etc_dir(), "emqx.conf"]).
|
||||
|
||||
parse_sections(Lines) ->
|
||||
{ok, P} = re:compile("#+\s*CONFIG_SECTION_(BGN|END)\s*=\s*([^\s-]+)\s*="),
|
||||
Parser =
|
||||
|
@ -57,7 +61,7 @@ parse_sections([Line | Lines], Parse, Section, Sections) ->
|
|||
|
||||
dump_sections([]) -> ok;
|
||||
dump_sections([{Name, Lines0} | Rest]) ->
|
||||
Filename = filename:join(["etc", iolist_to_binary([Name, ".conf.seg"])]),
|
||||
Filename = filename:join([etc_dir(), iolist_to_binary([Name, ".conf.seg"])]),
|
||||
Lines = [[L, "\n"] || L <- Lines0],
|
||||
ok = file:write_file(Filename, Lines),
|
||||
dump_sections(Rest).
|
||||
|
|
Loading…
Reference in New Issue