Merge pull request #8950 from zhongwencool/rename-emqx-enterprise.conf
feat: don't include emqx-entriprise.conf in opensource
This commit is contained in:
commit
b2732dc3ff
4
mix.exs
4
mix.exs
|
@ -388,9 +388,9 @@ defmodule EMQXUmbrella.MixProject do
|
||||||
|
|
||||||
if edition_type == :enterprise do
|
if edition_type == :enterprise do
|
||||||
render_template(
|
render_template(
|
||||||
"apps/emqx_conf/etc/emqx_enterprise.conf.all",
|
"apps/emqx_conf/etc/emqx-enterprise.conf.all",
|
||||||
assigns,
|
assigns,
|
||||||
Path.join(etc, "emqx_enterprise.conf")
|
Path.join(etc, "emqx-enterprise.conf")
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -479,7 +479,7 @@ emqx_etc_overlay_per_edition(ce) ->
|
||||||
];
|
];
|
||||||
emqx_etc_overlay_per_edition(ee) ->
|
emqx_etc_overlay_per_edition(ee) ->
|
||||||
[
|
[
|
||||||
{"{{base_dir}}/lib/emqx_conf/etc/emqx_enterprise.conf.all", "etc/emqx_enterprise.conf"},
|
{"{{base_dir}}/lib/emqx_conf/etc/emqx-enterprise.conf.all", "etc/emqx-enterprise.conf"},
|
||||||
{"{{base_dir}}/lib/emqx_conf/etc/emqx.conf.all", "etc/emqx.conf"}
|
{"{{base_dir}}/lib/emqx_conf/etc/emqx.conf.all", "etc/emqx.conf"}
|
||||||
].
|
].
|
||||||
|
|
||||||
|
|
|
@ -13,21 +13,32 @@
|
||||||
|
|
||||||
main(_) ->
|
main(_) ->
|
||||||
{ok, BaseConf} = file:read_file("apps/emqx_conf/etc/emqx_conf.conf"),
|
{ok, BaseConf} = file:read_file("apps/emqx_conf/etc/emqx_conf.conf"),
|
||||||
|
|
||||||
Cfgs = get_all_cfgs("apps/"),
|
Cfgs = get_all_cfgs("apps/"),
|
||||||
|
IsEnterprise = is_enterprise(),
|
||||||
|
Enterprise =
|
||||||
|
case IsEnterprise of
|
||||||
|
false -> [];
|
||||||
|
true -> [io_lib:nl(), "include emqx-enterprise.conf", io_lib:nl()]
|
||||||
|
end,
|
||||||
Conf = [
|
Conf = [
|
||||||
merge(BaseConf, Cfgs),
|
merge(BaseConf, Cfgs),
|
||||||
io_lib:nl(),
|
io_lib:nl(),
|
||||||
io_lib:nl(),
|
Enterprise
|
||||||
"include emqx_enterprise.conf",
|
|
||||||
io_lib:nl()
|
|
||||||
],
|
],
|
||||||
ok = file:write_file("apps/emqx_conf/etc/emqx.conf.all", Conf),
|
ok = file:write_file("apps/emqx_conf/etc/emqx.conf.all", Conf),
|
||||||
|
|
||||||
EnterpriseCfgs = get_all_cfgs("lib-ee/"),
|
case IsEnterprise of
|
||||||
EnterpriseConf = merge("", EnterpriseCfgs),
|
true ->
|
||||||
|
EnterpriseCfgs = get_all_cfgs("lib-ee/"),
|
||||||
|
EnterpriseConf = merge("", EnterpriseCfgs),
|
||||||
|
ok = file:write_file("apps/emqx_conf/etc/emqx-enterprise.conf.all", EnterpriseConf);
|
||||||
|
false ->
|
||||||
|
ok
|
||||||
|
end.
|
||||||
|
|
||||||
ok = file:write_file("apps/emqx_conf/etc/emqx_enterprise.conf.all", EnterpriseConf).
|
is_enterprise() ->
|
||||||
|
Profile = os:getenv("PROFILE", "emqx"),
|
||||||
|
nomatch =/= string:find(Profile, "enterprise").
|
||||||
|
|
||||||
merge(BaseConf, Cfgs) ->
|
merge(BaseConf, Cfgs) ->
|
||||||
lists:foldl(
|
lists:foldl(
|
||||||
|
|
Loading…
Reference in New Issue