diff --git a/Makefile b/Makefile index 1f8f17bbd..34f41c34c 100644 --- a/Makefile +++ b/Makefile @@ -88,8 +88,10 @@ $(REL_PROFILES:%=%): $(REBAR) get-dashboard clean: $(PROFILES:%=clean-%) $(PROFILES:%=clean-%): @if [ -d _build/$(@:clean-%=%) ]; then \ + rm rebar.lock \ rm -rf _build/$(@:clean-%=%)/rel; \ find _build/$(@:clean-%=%) -name '*.beam' -o -name '*.so' -o -name '*.app' -o -name '*.appup' -o -name '*.o' -o -name '*.d' -type f | xargs rm -f; \ + find _build/$(@:clean-%=%) -type l | xargs rm -i -f ; \ fi .PHONY: clean-all @@ -98,6 +100,7 @@ clean-all: .PHONY: deps-all deps-all: $(REBAR) $(PROFILES:%=deps-%) + @make clean # ensure clean at the end ## deps- is used in CI scripts to download deps and the ## share downloads between CI steps and/or copied into containers @@ -105,6 +108,7 @@ deps-all: $(REBAR) $(PROFILES:%=deps-%) .PHONY: $(PROFILES:%=deps-%) $(PROFILES:%=deps-%): $(REBAR) get-dashboard @$(REBAR) as $(@:deps-%=%) get-deps + @rm -f rebar.lock .PHONY: xref xref: $(REBAR) diff --git a/bin/node_dump b/bin/node_dump index 056b9a822..c8f76841b 100755 --- a/bin/node_dump +++ b/bin/node_dump @@ -2,14 +2,16 @@ set -eu ROOT_DIR="$(cd "$(dirname "$(readlink "$0" || echo "$0")")"/..; pwd -P)" - echo "Running node dump in ${ROOT_DIR}" +# shellcheck disable=SC1090 +. "$ROOT_DIR"/releases/emqx_vars + cd "${ROOT_DIR}" -DUMP="log/node_dump_$(date +"%Y%m%d_%H%M%S").tar.gz" -CONF_DUMP="log/conf.dump" -SYSINFO="log/sysinfo.txt" +DUMP="$RUNNER_LOG_DIR/node_dump_$(date +"%Y%m%d_%H%M%S").tar.gz" +CONF_DUMP="$RUNNER_LOG_DIR/conf.dump" +SYSINFO="$RUNNER_LOG_DIR/sysinfo.txt" LOG_MAX_AGE_DAYS=3 @@ -26,7 +28,7 @@ show_help() { USAGE: - bin/node_dump [-a DAYS] + $0 [-a DAYS] OPTIONS: @@ -44,29 +46,29 @@ done # Collect system info: { - collect bin/emqx_ctl broker - collect bin/emqx eval "'emqx_node_dump:sys_info()'" + collect "$RUNNER_BIN_DIR"/emqx_ctl broker + collect "$RUNNER_BIN_DIR"/emqx eval "'emqx_node_dump:sys_info()'" collect uname -a collect uptime collect free collect netstat -tnl - collect bin/emqx_ctl plugins list - collect bin/emqx_ctl modules list + collect "$RUNNER_BIN_DIR"/emqx_ctl plugins list + collect "$RUNNER_BIN_DIR"/emqx_ctl modules list - collect bin/emqx_ctl vm all - collect bin/emqx_ctl listeners + collect "$RUNNER_BIN_DIR"/emqx_ctl vm all + collect "$RUNNER_BIN_DIR"/emqx_ctl listeners } > "${SYSINFO}" # Collect information about the configuration: { - collect bin/emqx eval "'emqx_node_dump:app_env_dump()'" + collect "$RUNNER_BIN_DIR"/emqx eval "'emqx_node_dump:app_env_dump()'" } > "${CONF_DUMP}" # Pack files { - find log -mtime -"${LOG_MAX_AGE_DAYS}" \( -name '*.log.*' -or -name 'run_erl.log*' \) + find "$RUNNER_LOG_DIR" -mtime -"${LOG_MAX_AGE_DAYS}" \( -name '*.log.*' -or -name 'run_erl.log*' \) echo "${SYSINFO}" echo "${CONF_DUMP}" } | tar czf "${DUMP}" -T -