feat: change node.applications default to []

This commit is contained in:
Zhongwen Deng 2022-06-06 16:03:33 +08:00
parent 9ea923d9d7
commit eb2a4df4af
4 changed files with 34 additions and 76 deletions

View File

@ -13,7 +13,6 @@ node {
cookie: emqxsecretcookie
data_dir: "{{ platform_data_dir }}"
etc_dir: "{{ platform_etc_dir }}"
applications: "{{ emqx_machine_boot_apps }}"
}
log {

View File

@ -102,10 +102,39 @@ restart_type(App) ->
%% 2. after join a cluster
%% the list of (re)started apps depends on release type/edition
%% and is configured in rebar.config.erl/mix.exs
reboot_apps() ->
{ok, Apps} = application:get_env(emqx_machine, applications),
?BASIC_REBOOT_APPS ++ Apps.
{ok, ConfigApps0} = application:get_env(emqx_machine, applications),
BaseRebootApps = basic_reboot_apps(),
ConfigApps = lists:filter(fun(App) -> not lists:member(App, BaseRebootApps) end, ConfigApps0),
BaseRebootApps ++ ConfigApps.
basic_reboot_apps() ->
CE =
?BASIC_REBOOT_APPS ++
[
emqx_prometheus,
emqx_modules,
emqx_dashboard,
emqx_connector,
emqx_gateway,
emqx_statsd,
emqx_resource,
emqx_rule_engine,
emqx_bridge,
emqx_plugin_libs,
emqx_management,
emqx_retainer,
emqx_exhook,
emqx_authn,
emqx_authz,
emqx_slow_subs,
emqx_auto_subscribe,
emqx_plugins
],
case emqx_release:edition() of
ce -> CE;
ee -> CE ++ []
end.
sorted_reboot_apps() ->
Apps = [{App, app_deps(App)} || App <- reboot_apps()],

37
mix.exs
View File

@ -215,34 +215,6 @@ defmodule EMQXUmbrella.MixProject do
)
end
def emqx_machine_boot_apps(:community) do
[
:emqx_prometheus,
:emqx_modules,
:emqx_dashboard,
:emqx_connector,
:emqx_gateway,
:emqx_statsd,
:emqx_resource,
:emqx_rule_engine,
:emqx_bridge,
:emqx_plugin_libs,
:emqx_management,
:emqx_retainer,
:emqx_exhook,
:emqx_authn,
:emqx_authz,
:emqx_auto_subscribe,
:emqx_slow_subs,
:emqx_plugins
]
end
def emqx_machine_boot_apps(:enterprise) do
emqx_machine_boot_apps(:community) ++
[]
end
defp is_app(name) do
case Application.load(name) do
:ok ->
@ -256,13 +228,6 @@ defmodule EMQXUmbrella.MixProject do
end
end
defp emqx_machine_boot_app_list(edition_type) do
edition_type
|> emqx_machine_boot_apps()
|> Enum.map(&Atom.to_string/1)
|> Enum.join(", ")
end
def check_profile!() do
valid_envs = [
:dev,
@ -559,7 +524,6 @@ defmodule EMQXUmbrella.MixProject do
erl_opts: "",
emqx_description: emqx_description(release_type, edition_type),
emqx_schema_mod: emqx_schema_mod(edition_type),
emqx_machine_boot_apps: emqx_machine_boot_app_list(edition_type),
is_elixir: "yes",
is_enterprise: if(edition_type == :enterprise, do: "yes", else: "no")
] ++ build_info()
@ -582,7 +546,6 @@ defmodule EMQXUmbrella.MixProject do
erl_opts: "",
emqx_description: emqx_description(release_type, edition_type),
emqx_schema_mod: emqx_schema_mod(edition_type),
emqx_machine_boot_apps: emqx_machine_boot_app_list(edition_type),
is_elixir: "yes",
is_enterprise: if(edition_type == :enterprise, do: "yes", else: "no")
] ++ build_info()

View File

@ -256,14 +256,12 @@ overlay_vars_rel(cloud) ->
overlay_vars_edition(ce) ->
[
{emqx_schema_mod, emqx_conf_schema},
{is_enterprise, "no"},
{emqx_machine_boot_apps, emqx_machine_boot_app_list(ce)}
{is_enterprise, "no"}
];
overlay_vars_edition(ee) ->
[
{emqx_schema_mod, emqx_enterprise_conf_schema},
{is_enterprise, "yes"},
{emqx_machine_boot_apps, emqx_machine_boot_app_list(ee)}
{is_enterprise, "yes"}
].
%% vars per packaging type, bin(zip/tar.gz/docker) or pkg(rpm/deb)
@ -362,37 +360,6 @@ relx_apps_per_edition(ee) ->
relx_apps_per_edition(ce) ->
[].
emqx_machine_boot_apps(ce) ->
[
emqx_prometheus,
emqx_modules,
emqx_dashboard,
emqx_connector,
emqx_gateway,
emqx_statsd,
emqx_resource,
emqx_rule_engine,
emqx_bridge,
emqx_plugin_libs,
emqx_management,
emqx_retainer,
emqx_exhook,
emqx_authn,
emqx_authz,
emqx_slow_subs,
emqx_auto_subscribe,
emqx_plugins
];
emqx_machine_boot_apps(ee) ->
emqx_machine_boot_apps(ce) ++
[].
emqx_machine_boot_app_list(Edition) ->
string:join(
[atom_to_list(AppName) || AppName <- emqx_machine_boot_apps(Edition)],
", "
).
relx_overlay(ReleaseType, Edition) ->
[
{mkdir, "log/"},