chore(build): add more enterprise build support (#4302)
This commit is contained in:
parent
72f5468001
commit
115397523d
7
bin/emqx
7
bin/emqx
|
@ -209,7 +209,12 @@ generate_config() {
|
||||||
# the vm, we need to pass it in twice.
|
# the vm, we need to pass it in twice.
|
||||||
CONFIG_ARGS=" -config $RUNNER_ETC_DIR/app.config -args_file $RUNNER_ETC_DIR/vm.args -vm_args $RUNNER_ETC_DIR/vm.args "
|
CONFIG_ARGS=" -config $RUNNER_ETC_DIR/app.config -args_file $RUNNER_ETC_DIR/vm.args -vm_args $RUNNER_ETC_DIR/vm.args "
|
||||||
else
|
else
|
||||||
CONFIG_ARGS=$("$ERTS_PATH"/escript "$RUNNER_ROOT_DIR"/bin/cuttlefish -i "$REL_DIR"/emqx.schema -c "$RUNNER_ETC_DIR"/emqx.conf -d "$RUNNER_DATA_DIR"/configs generate)
|
EMQX_LICENSE_CONF_OPTION=""
|
||||||
|
if [ "${EMQX_LICENSE_CONF:-}" != "" ]; then
|
||||||
|
EMQX_LICENSE_CONF_OPTION="-i ${EMQX_LICENSE_CONF}"
|
||||||
|
fi
|
||||||
|
# shellcheck disable=SC2086
|
||||||
|
CONFIG_ARGS=$("$ERTS_PATH"/escript "$RUNNER_ROOT_DIR"/bin/cuttlefish -i "$REL_DIR"/emqx.schema $EMQX_LICENSE_CONF_OPTION -c "$RUNNER_ETC_DIR"/emqx.conf -d "$RUNNER_DATA_DIR"/configs generate)
|
||||||
|
|
||||||
## Merge cuttlefish generated *.args into the vm.args
|
## Merge cuttlefish generated *.args into the vm.args
|
||||||
CUTTLE_GEN_ARG_FILE=$(echo "$CONFIG_ARGS" | sed -n 's/^.*\(vm_args[[:space:]]\)//p' | awk '{print $1}')
|
CUTTLE_GEN_ARG_FILE=$(echo "$CONFIG_ARGS" | sed -n 's/^.*\(vm_args[[:space:]]\)//p' | awk '{print $1}')
|
||||||
|
|
|
@ -16,6 +16,7 @@ RUNNER_USER="{{ runner_user }}"
|
||||||
EMQX_DISCR="{{ emqx_description }}"
|
EMQX_DISCR="{{ emqx_description }}"
|
||||||
LIB_EKKA_DIR="${RUNNER_LIB_DIR}/ekka-$(grep ekka "${RUNNER_ROOT_DIR}/releases/RELEASES" | awk -F '\"' '{print $2}')"
|
LIB_EKKA_DIR="${RUNNER_LIB_DIR}/ekka-$(grep ekka "${RUNNER_ROOT_DIR}/releases/RELEASES" | awk -F '\"' '{print $2}')"
|
||||||
|
|
||||||
|
EMQX_LICENSE_CONF=''
|
||||||
## computed vars
|
## computed vars
|
||||||
REL_NAME="emqx"
|
REL_NAME="emqx"
|
||||||
ERTS_PATH="$RUNNER_ROOT_DIR/erts-$ERTS_VSN/bin"
|
ERTS_PATH="$RUNNER_ROOT_DIR/erts-$ERTS_VSN/bin"
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
{emqx_management, true}.
|
{emqx_management, true}.
|
||||||
{emqx_recon, true}.
|
|
||||||
{emqx_retainer, true}.
|
|
||||||
{emqx_dashboard, true}.
|
{emqx_dashboard, true}.
|
||||||
{emqx_telemetry, true}.
|
{emqx_modules, {{enable_plugin_emqx_modules}}}.
|
||||||
|
{emqx_recon, {{enable_plugin_emqx_recon}}}.
|
||||||
|
{emqx_retainer, {{enable_plugin_emqx_retainer}}}.
|
||||||
|
{emqx_telemetry, {{enable_plugin_emqx_telemetry}}}.
|
||||||
{emqx_rule_engine, {{enable_plugin_emqx_rule_engine}}}.
|
{emqx_rule_engine, {{enable_plugin_emqx_rule_engine}}}.
|
||||||
{emqx_bridge_mqtt, {{enable_plugin_emqx_bridge_mqtt}}}.
|
{emqx_bridge_mqtt, {{enable_plugin_emqx_bridge_mqtt}}}.
|
||||||
|
|
|
@ -87,7 +87,8 @@ listener_name(Proto) ->
|
||||||
http_handlers() ->
|
http_handlers() ->
|
||||||
Plugins = lists:map(fun(Plugin) -> Plugin#plugin.name end, emqx_plugins:list()),
|
Plugins = lists:map(fun(Plugin) -> Plugin#plugin.name end, emqx_plugins:list()),
|
||||||
[{"/api/v4/",
|
[{"/api/v4/",
|
||||||
minirest:handler(#{apps => Plugins, filter => fun ?MODULE:filter/1}),
|
minirest:handler(#{apps => Plugins ++ [emqx_modules],
|
||||||
|
filter => fun ?MODULE:filter/1}),
|
||||||
[{authorization, fun ?MODULE:is_authorized/1}]}].
|
[{authorization, fun ?MODULE:is_authorized/1}]}].
|
||||||
|
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
|
@ -113,6 +114,7 @@ is_authorized(_Path, Req) ->
|
||||||
_ -> false
|
_ -> false
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
filter(#{app := emqx_modules}) -> true;
|
||||||
filter(#{app := App}) ->
|
filter(#{app := App}) ->
|
||||||
case emqx_plugins:find_plugin(App) of
|
case emqx_plugins:find_plugin(App) of
|
||||||
false -> false;
|
false -> false;
|
||||||
|
|
|
@ -164,8 +164,9 @@ relx_apps(ReleaseType) ->
|
||||||
, {mnesia, load}
|
, {mnesia, load}
|
||||||
, {ekka, load}
|
, {ekka, load}
|
||||||
, {emqx_plugin_libs, load}
|
, {emqx_plugin_libs, load}
|
||||||
, emqx_modules
|
|
||||||
]
|
]
|
||||||
|
++ [emqx_modules || not is_enterprise()]
|
||||||
|
++ [emqx_license || is_enterprise()]
|
||||||
++ [bcrypt || provide_bcrypt_release(ReleaseType)]
|
++ [bcrypt || provide_bcrypt_release(ReleaseType)]
|
||||||
++ relx_apps_per_rel(ReleaseType)
|
++ relx_apps_per_rel(ReleaseType)
|
||||||
++ [{N, load} || N <- relx_plugin_apps(ReleaseType)].
|
++ [{N, load} || N <- relx_plugin_apps(ReleaseType)].
|
||||||
|
@ -194,7 +195,6 @@ relx_plugin_apps(ReleaseType) ->
|
||||||
, emqx_recon
|
, emqx_recon
|
||||||
, emqx_rule_engine
|
, emqx_rule_engine
|
||||||
, emqx_sasl
|
, emqx_sasl
|
||||||
, emqx_modules
|
|
||||||
]
|
]
|
||||||
++ [emqx_telemetry || not is_enterprise()]
|
++ [emqx_telemetry || not is_enterprise()]
|
||||||
++ relx_plugin_apps_per_rel(ReleaseType)
|
++ relx_plugin_apps_per_rel(ReleaseType)
|
||||||
|
@ -246,7 +246,7 @@ relx_overlay(ReleaseType) ->
|
||||||
, {copy, "_build/default/lib/cuttlefish/cuttlefish", "bin/cuttlefish"}
|
, {copy, "_build/default/lib/cuttlefish/cuttlefish", "bin/cuttlefish"}
|
||||||
, {copy, "_build/default/lib/cuttlefish/cuttlefish", "bin/cuttlefish-{{release_version}}"}
|
, {copy, "_build/default/lib/cuttlefish/cuttlefish", "bin/cuttlefish-{{release_version}}"}
|
||||||
, {copy, "priv/emqx.schema", "releases/{{release_version}}/"}
|
, {copy, "priv/emqx.schema", "releases/{{release_version}}/"}
|
||||||
] ++ etc_overlay(ReleaseType).
|
] ++ ee_etc_overlay() ++ etc_overlay(ReleaseType).
|
||||||
|
|
||||||
etc_overlay(ReleaseType) ->
|
etc_overlay(ReleaseType) ->
|
||||||
PluginApps = relx_plugin_apps(ReleaseType),
|
PluginApps = relx_plugin_apps(ReleaseType),
|
||||||
|
@ -394,3 +394,4 @@ list_dir(Dir) ->
|
||||||
%% ==== Enterprise supports below ==================================================================
|
%% ==== Enterprise supports below ==================================================================
|
||||||
|
|
||||||
ee_profiles(_Vsn) -> [].
|
ee_profiles(_Vsn) -> [].
|
||||||
|
ee_etc_overlay() -> [].
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
{enable_plugin_emqx_rule_engine, true}.
|
{enable_plugin_emqx_rule_engine, true}.
|
||||||
{enable_plugin_emqx_bridge_mqtt, false}.
|
{enable_plugin_emqx_bridge_mqtt, false}.
|
||||||
|
{enable_plugin_emqx_modules, false}.
|
||||||
|
{enable_plugin_emqx_recon, true}.
|
||||||
|
{enable_plugin_emqx_retainer, true}.
|
||||||
|
{enable_plugin_emqx_telemetry, true}.
|
||||||
{vm_args_file, "vm.args"}.
|
{vm_args_file, "vm.args"}.
|
||||||
{emqx_description, "EMQ X Broker"}.
|
{emqx_description, "EMQ X Broker"}.
|
|
@ -1,4 +1,8 @@
|
||||||
{enable_plugin_emqx_rule_engine, false}.
|
{enable_plugin_emqx_rule_engine, false}.
|
||||||
{enable_plugin_emqx_bridge_mqtt, true}.
|
{enable_plugin_emqx_bridge_mqtt, true}.
|
||||||
|
{enable_plugin_emqx_modules, false}.
|
||||||
|
{enable_plugin_emqx_recon, true}.
|
||||||
|
{enable_plugin_emqx_retainer, true}.
|
||||||
|
{enable_plugin_emqx_telemetry, true}.
|
||||||
{vm_args_file, "vm.args.edge"}.
|
{vm_args_file, "vm.args.edge"}.
|
||||||
{emqx_description, "EMQ X Edge"}.
|
{emqx_description, "EMQ X Edge"}.
|
||||||
|
|
Loading…
Reference in New Issue