From 49f844b1ddf1bcb49c335abc7b5f3ce0013437a8 Mon Sep 17 00:00:00 2001 From: Zaiming Shi Date: Mon, 14 Jun 2021 18:56:03 +0200 Subject: [PATCH] feat(bin/emqx): simlified config generation commands --- bin/emqx | 53 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 20 deletions(-) diff --git a/bin/emqx b/bin/emqx index 96f6ec42f..ed66dee68 100755 --- a/bin/emqx +++ b/bin/emqx @@ -20,6 +20,10 @@ mkdir -p "$RUNNER_LOG_DIR" # Make sure data directory exists mkdir -p "$RUNNER_DATA_DIR" +# Make sure data/configs exists +CONFIGS_DIR="$RUNNER_DATA_DIR/configs" +mkdir -p "$CONFIGS_DIR" + # hocon try to read environment variables starting with "EMQX_" export HOCON_ENV_OVERRIDE_PREFIX='EMQX_' @@ -204,39 +208,48 @@ generate_config() { EMQX_LICENSE_CONF_OPTION="-c ${EMQX_LICENSE_CONF}" fi - set +e - # disable shellcheck; let EMQX_LICENSE_CONF_OPTION split + ## timestamp for each generation + local NOW_TIME + NOW_TIME="$("$ERTS_PATH"/escript "$RUNNER_ROOT_DIR"/bin/hocon now_time)" + + ## ths command populates two files: app.