Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(plugins): create directory before uploading #10300

Merged
merged 1 commit into from
Mar 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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),
lafirest marked this conversation as resolved.
Show resolved Hide resolved
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