Просмотр исходного кода

Merge pull request #6934 from thalesmg/mix-node-dump

fix(mix): include `node_dump` in tgz and packages
Thales Macedo Garitezi 4 лет назад
Родитель
Сommit
4a93b22cc1
3 измененных файлов с 26 добавлено и 7 удалено
  1. 2 2
      bin/node_dump
  2. 18 1
      mix.exs
  3. 6 4
      scripts/check-elixir-emqx-machine-boot-discrepancies.exs

+ 2 - 2
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

+ 18 - 1
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
 
   #############################################################################

+ 6 - 4
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