Merge pull request #7765 from thalesmg/node-dump-license-info

feat(node_dump): add license info to node_dump
This commit is contained in:
Thales Macedo Garitezi 2022-04-26 09:04:12 -03:00 committed by GitHub
commit e59bea03ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -114,6 +114,10 @@ jobs:
echo "DUMP_CONTAINER_LOGS_END"
exit 1
fi
# simple smoke test for node_dump
- name: test node_dump
run: |
docker exec node1.emqx.io node_dump
helm_test:
runs-on: ubuntu-20.04

View File

@ -12,6 +12,7 @@ cd "${RUNNER_ROOT_DIR}"
DUMP="$RUNNER_LOG_DIR/node_dump_$(date +"%Y%m%d_%H%M%S").tar.gz"
CONF_DUMP="$RUNNER_LOG_DIR/conf.dump"
LICENSE_INFO="$RUNNER_LOG_DIR/license_info.txt"
SYSINFO="$RUNNER_LOG_DIR/sysinfo.txt"
LOG_MAX_AGE_DAYS=3
@ -66,15 +67,21 @@ done
collect "$RUNNER_BIN_DIR"/emqx eval-erl "'emqx_node_dump:app_env_dump()'"
} > "${CONF_DUMP}"
# Collect license info:
{
collect "$RUNNER_BIN_DIR"/emqx_ctl license info
} > "${LICENSE_INFO}"
# Pack files
{
find "$RUNNER_LOG_DIR" -mtime -"${LOG_MAX_AGE_DAYS}" \( -name '*.log.*' -or -name 'run_erl.log*' \)
echo "${SYSINFO}"
echo "${CONF_DUMP}"
echo "${LICENSE_INFO}"
} | tar czf "${DUMP}" -T -
## Cleanup:
rm "${SYSINFO}"
rm "${SYSINFO}" "${LICENSE_INFO}"
#rm "${CONF_DUMP}" # Keep it for inspection
echo "Created a node dump ${DUMP}"