From eea217093b1b10c561537c6d03cbc53f5221720e Mon Sep 17 00:00:00 2001 From: Thales Macedo Garitezi Date: Mon, 7 Feb 2022 16:56:33 -0300 Subject: [PATCH] fix(mix): include `node_dump` in tgz and packages --- bin/node_dump | 4 ++-- mix.exs | 19 ++++++++++++++++++- ...elixir-emqx-machine-boot-discrepancies.exs | 10 ++++++---- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/bin/node_dump b/bin/node_dump index 3640fada9..20b36b826 100755 --- a/bin/node_dump +++ b/bin/node_dump @@ -48,7 +48,7 @@ done # Collect system info: { collect "$RUNNER_BIN_DIR"/emqx_ctl broker - collect "$RUNNER_BIN_DIR"/emqx eval "'emqx_node_dump:sys_info()'" + collect "$RUNNER_BIN_DIR"/emqx eval-erl "'emqx_node_dump:sys_info()'" collect uname -a collect uptime @@ -64,7 +64,7 @@ done # Collect information about the configuration: { - collect "$RUNNER_BIN_DIR"/emqx eval "'emqx_node_dump:app_env_dump()'" + collect "$RUNNER_BIN_DIR"/emqx eval-erl "'emqx_node_dump:app_env_dump()'" } > "${CONF_DUMP}" # Pack files diff --git a/mix.exs b/mix.exs index 7ff32113e..c23b0cad8 100644 --- a/mix.exs +++ b/mix.exs @@ -417,6 +417,14 @@ defmodule EMQXUmbrella.MixProject do File.chmod!(Path.join(bin, name), 0o755) end + Mix.Generator.copy_file( + "bin/node_dump", + Path.join(bin, "node_dump"), + force: overwrite? + ) + + File.chmod!(Path.join(bin, "node_dump"), 0o755) + render_template( "rel/BUILT_ON", assigns, @@ -505,7 +513,16 @@ defmodule EMQXUmbrella.MixProject do # add those to the `:overlays` key before running `:tar`. # See: https://hexdocs.pm/mix/1.13.2/Mix.Release.html#__struct__/0 defp prepare_tar_overlays(release) do - Map.update!(release, :overlays, &["etc", "data" | &1]) + Map.update!( + release, + :overlays, + &[ + "etc", + "data", + "bin/node_dump" + | &1 + ] + ) end ############################################################################# diff --git a/scripts/check-elixir-emqx-machine-boot-discrepancies.exs b/scripts/check-elixir-emqx-machine-boot-discrepancies.exs index 62041884a..d07e6978f 100755 --- a/scripts/check-elixir-emqx-machine-boot-discrepancies.exs +++ b/scripts/check-elixir-emqx-machine-boot-discrepancies.exs @@ -27,18 +27,20 @@ defmodule CheckElixirEMQXMachineBootDiscrepancies do if Enum.any?(mix_missing) do IO.puts( "For profile=#{profile}, edition=#{inputs.edition_type} " <> - "rebar.config.erl has the following emqx_machine_boot_apps " <> - "that are missing in mix.exs:" + "rebar.config.erl has the following emqx_machine_boot_apps " <> + "that are missing in mix.exs:" ) + IO.inspect(mix_missing, syntax_colors: [atom: :red]) end if Enum.any?(rebar_missing) do IO.puts( "For profile=#{profile}, edition=#{inputs.edition_type} " <> - "mix.exs has the following emqx_machine_boot_apps " <> - "that are missing in rebar3.config.erl:" + "mix.exs has the following emqx_machine_boot_apps " <> + "that are missing in rebar3.config.erl:" ) + IO.inspect(rebar_missing, syntax_colors: [atom: :red]) end