feat: don't include emqx-entriprise.conf in opensource

This commit is contained in:
Zhongwen Deng 2022-09-13 18:53:09 +08:00
parent 752eaeb899
commit 6a470dc3ac
3 changed files with 11 additions and 8 deletions

View File

@ -373,9 +373,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

View File

@ -477,7 +477,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"}
]. ].

View File

@ -12,22 +12,25 @@
-define(APPS, ["emqx", "emqx_dashboard", "emqx_authz"]). -define(APPS, ["emqx", "emqx_dashboard", "emqx_authz"]).
main(_) -> main(_) ->
Profile = os:getenv("PROFILE", "emqx"),
{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/"),
Enterprise =
case Profile of
"emqx" -> [];
"emqx-enterprise" -> [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/"), EnterpriseCfgs = get_all_cfgs("lib-ee/"),
EnterpriseConf = merge("", EnterpriseCfgs), EnterpriseConf = merge("", EnterpriseCfgs),
ok = file:write_file("apps/emqx_conf/etc/emqx_enterprise.conf.all", EnterpriseConf). ok = file:write_file("apps/emqx_conf/etc/emqx-enterprise.conf.all", EnterpriseConf).
merge(BaseConf, Cfgs) -> merge(BaseConf, Cfgs) ->
lists:foldl( lists:foldl(