commit
e5ffe8d7d5
4
Makefile
4
Makefile
|
@ -88,8 +88,10 @@ $(REL_PROFILES:%=%): $(REBAR) get-dashboard
|
||||||
clean: $(PROFILES:%=clean-%)
|
clean: $(PROFILES:%=clean-%)
|
||||||
$(PROFILES:%=clean-%):
|
$(PROFILES:%=clean-%):
|
||||||
@if [ -d _build/$(@:clean-%=%) ]; then \
|
@if [ -d _build/$(@:clean-%=%) ]; then \
|
||||||
|
rm rebar.lock \
|
||||||
rm -rf _build/$(@:clean-%=%)/rel; \
|
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-%=%) -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
|
fi
|
||||||
|
|
||||||
.PHONY: clean-all
|
.PHONY: clean-all
|
||||||
|
@ -98,6 +100,7 @@ clean-all:
|
||||||
|
|
||||||
.PHONY: deps-all
|
.PHONY: deps-all
|
||||||
deps-all: $(REBAR) $(PROFILES:%=deps-%)
|
deps-all: $(REBAR) $(PROFILES:%=deps-%)
|
||||||
|
@make clean # ensure clean at the end
|
||||||
|
|
||||||
## deps-<profile> is used in CI scripts to download deps and the
|
## deps-<profile> is used in CI scripts to download deps and the
|
||||||
## share downloads between CI steps and/or copied into containers
|
## share downloads between CI steps and/or copied into containers
|
||||||
|
@ -105,6 +108,7 @@ deps-all: $(REBAR) $(PROFILES:%=deps-%)
|
||||||
.PHONY: $(PROFILES:%=deps-%)
|
.PHONY: $(PROFILES:%=deps-%)
|
||||||
$(PROFILES:%=deps-%): $(REBAR) get-dashboard
|
$(PROFILES:%=deps-%): $(REBAR) get-dashboard
|
||||||
@$(REBAR) as $(@:deps-%=%) get-deps
|
@$(REBAR) as $(@:deps-%=%) get-deps
|
||||||
|
@rm -f rebar.lock
|
||||||
|
|
||||||
.PHONY: xref
|
.PHONY: xref
|
||||||
xref: $(REBAR)
|
xref: $(REBAR)
|
||||||
|
|
|
@ -2,14 +2,16 @@
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
ROOT_DIR="$(cd "$(dirname "$(readlink "$0" || echo "$0")")"/..; pwd -P)"
|
ROOT_DIR="$(cd "$(dirname "$(readlink "$0" || echo "$0")")"/..; pwd -P)"
|
||||||
|
|
||||||
echo "Running node dump in ${ROOT_DIR}"
|
echo "Running node dump in ${ROOT_DIR}"
|
||||||
|
|
||||||
|
# shellcheck disable=SC1090
|
||||||
|
. "$ROOT_DIR"/releases/emqx_vars
|
||||||
|
|
||||||
cd "${ROOT_DIR}"
|
cd "${ROOT_DIR}"
|
||||||
|
|
||||||
DUMP="log/node_dump_$(date +"%Y%m%d_%H%M%S").tar.gz"
|
DUMP="$RUNNER_LOG_DIR/node_dump_$(date +"%Y%m%d_%H%M%S").tar.gz"
|
||||||
CONF_DUMP="log/conf.dump"
|
CONF_DUMP="$RUNNER_LOG_DIR/conf.dump"
|
||||||
SYSINFO="log/sysinfo.txt"
|
SYSINFO="$RUNNER_LOG_DIR/sysinfo.txt"
|
||||||
|
|
||||||
LOG_MAX_AGE_DAYS=3
|
LOG_MAX_AGE_DAYS=3
|
||||||
|
|
||||||
|
@ -26,7 +28,7 @@ show_help() {
|
||||||
|
|
||||||
USAGE:
|
USAGE:
|
||||||
|
|
||||||
bin/node_dump [-a DAYS]
|
$0 [-a DAYS]
|
||||||
|
|
||||||
OPTIONS:
|
OPTIONS:
|
||||||
|
|
||||||
|
@ -44,29 +46,29 @@ done
|
||||||
|
|
||||||
# Collect system info:
|
# Collect system info:
|
||||||
{
|
{
|
||||||
collect bin/emqx_ctl broker
|
collect "$RUNNER_BIN_DIR"/emqx_ctl broker
|
||||||
collect bin/emqx eval "'emqx_node_dump:sys_info()'"
|
collect "$RUNNER_BIN_DIR"/emqx eval "'emqx_node_dump:sys_info()'"
|
||||||
|
|
||||||
collect uname -a
|
collect uname -a
|
||||||
collect uptime
|
collect uptime
|
||||||
collect free
|
collect free
|
||||||
collect netstat -tnl
|
collect netstat -tnl
|
||||||
|
|
||||||
collect bin/emqx_ctl plugins list
|
collect "$RUNNER_BIN_DIR"/emqx_ctl plugins list
|
||||||
collect bin/emqx_ctl modules list
|
collect "$RUNNER_BIN_DIR"/emqx_ctl modules list
|
||||||
|
|
||||||
collect bin/emqx_ctl vm all
|
collect "$RUNNER_BIN_DIR"/emqx_ctl vm all
|
||||||
collect bin/emqx_ctl listeners
|
collect "$RUNNER_BIN_DIR"/emqx_ctl listeners
|
||||||
} > "${SYSINFO}"
|
} > "${SYSINFO}"
|
||||||
|
|
||||||
# Collect information about the configuration:
|
# 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}"
|
} > "${CONF_DUMP}"
|
||||||
|
|
||||||
# Pack files
|
# 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 "${SYSINFO}"
|
||||||
echo "${CONF_DUMP}"
|
echo "${CONF_DUMP}"
|
||||||
} | tar czf "${DUMP}" -T -
|
} | tar czf "${DUMP}" -T -
|
||||||
|
|
Loading…
Reference in New Issue