Skip to content

Commit

Permalink
Merge pull request #10300 from thalesmg/fix-plugin-upload-v50
Browse files Browse the repository at this point in the history
fix(plugins): create directory before uploading
  • Loading branch information
thalesmg committed Mar 31, 2023
2 parents 58898ea + a2b82da commit 53d760e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/emqx_management/src/emqx_mgmt_api_plugins.erl
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ update_boot_order(post, #{bindings := #{name := Name}, body := Body}) ->
%% For RPC upload_install/2
install_package(FileName, Bin) ->
File = filename:join(emqx_plugins:install_dir(), FileName),
ok = filelib:ensure_dir(File),
ok = file:write_file(File, Bin),
PackageName = string:trim(FileName, trailing, ".tar.gz"),
case emqx_plugins:ensure_installed(PackageName) of
Expand Down
1 change: 1 addition & 0 deletions changes/ce/fix-10300.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed an issue where a build made with Elixir could not receive uploaded plugins until the `plugins` folder was created manually to receive the uploaded files.
3 changes: 3 additions & 0 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -394,10 +394,12 @@ defmodule EMQXUmbrella.MixProject do
bin = Path.join(release.path, "bin")
etc = Path.join(release.path, "etc")
log = Path.join(release.path, "log")
plugins = Path.join(release.path, "plugins")

Mix.Generator.create_directory(bin)
Mix.Generator.create_directory(etc)
Mix.Generator.create_directory(log)
Mix.Generator.create_directory(plugins)
Mix.Generator.create_directory(Path.join(etc, "certs"))

Enum.each(
Expand Down Expand Up @@ -610,6 +612,7 @@ defmodule EMQXUmbrella.MixProject do
&[
"etc",
"data",
"plugins",
"bin/node_dump"
| &1
]
Expand Down

0 comments on commit 53d760e

Please sign in to comment.