feat(config): print override env (#4517)
This commit is contained in:
parent
e4242814f6
commit
e3a5f65c88
7
bin/emqx
7
bin/emqx
|
@ -213,8 +213,13 @@ generate_config() {
|
||||||
if [ "${EMQX_LICENSE_CONF:-}" != "" ]; then
|
if [ "${EMQX_LICENSE_CONF:-}" != "" ]; then
|
||||||
EMQX_LICENSE_CONF_OPTION="-i ${EMQX_LICENSE_CONF}"
|
EMQX_LICENSE_CONF_OPTION="-i ${EMQX_LICENSE_CONF}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# shellcheck disable=SC2086
|
# 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)
|
CONFIG="$("$ERTS_PATH"/escript "$RUNNER_ROOT_DIR"/bin/cuttlefish -v -i "$REL_DIR"/emqx.schema $EMQX_LICENSE_CONF_OPTION -c "$RUNNER_ETC_DIR"/emqx.conf -d "$RUNNER_DATA_DIR"/configs generate)"
|
||||||
|
# print override from environment variables (EMQX_*)
|
||||||
|
echo "$CONFIG" | sed -e '$d'
|
||||||
|
CONFIG_ARGS=$(echo "$CONFIG" | tail -n 1)
|
||||||
|
|
||||||
|
|
||||||
## 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}')
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
, {esockd, {git, "https://github.com/emqx/esockd", {tag, "5.8.0"}}}
|
, {esockd, {git, "https://github.com/emqx/esockd", {tag, "5.8.0"}}}
|
||||||
, {ekka, {git, "https://github.com/emqx/ekka", {tag, "0.8.0"}}}
|
, {ekka, {git, "https://github.com/emqx/ekka", {tag, "0.8.0"}}}
|
||||||
, {gen_rpc, {git, "https://github.com/emqx/gen_rpc", {tag, "2.5.0"}}}
|
, {gen_rpc, {git, "https://github.com/emqx/gen_rpc", {tag, "2.5.0"}}}
|
||||||
, {cuttlefish, {git, "https://github.com/emqx/cuttlefish", {tag, "v3.2.1"}}}
|
, {cuttlefish, {git, "https://github.com/emqx/cuttlefish", {tag, "v3.3.0"}}}
|
||||||
, {minirest, {git, "https://github.com/emqx/minirest", {tag, "0.3.5"}}}
|
, {minirest, {git, "https://github.com/emqx/minirest", {tag, "0.3.5"}}}
|
||||||
, {ecpool, {git, "https://github.com/emqx/ecpool", {tag, "0.5.0"}}}
|
, {ecpool, {git, "https://github.com/emqx/ecpool", {tag, "0.5.0"}}}
|
||||||
, {replayq, {git, "https://github.com/emqx/replayq", {tag, "0.3.2"}}}
|
, {replayq, {git, "https://github.com/emqx/replayq", {tag, "0.3.2"}}}
|
||||||
|
|
|
@ -232,7 +232,8 @@ generate_configs(App) ->
|
||||||
{_, true} ->
|
{_, true} ->
|
||||||
Schema = cuttlefish_schema:files([SchemaFile]),
|
Schema = cuttlefish_schema:files([SchemaFile]),
|
||||||
Conf = cuttlefish_conf:file(ConfFile),
|
Conf = cuttlefish_conf:file(ConfFile),
|
||||||
cuttlefish_generator:map(Schema, Conf);
|
LogFun = fun(Key, Value) -> ?LOG(info, "~s = ~p", [string:join(Key, "."), Value]) end,
|
||||||
|
cuttlefish_generator:map(Schema, Conf, undefined, LogFun);
|
||||||
{false, false} ->
|
{false, false} ->
|
||||||
error({config_not_found, {ConfigFile, ConfFile, SchemaFile}})
|
error({config_not_found, {ConfigFile, ConfFile, SchemaFile}})
|
||||||
end.
|
end.
|
||||||
|
|
Loading…
Reference in New Issue