chore: add emqx-example-en.conf in release

This commit is contained in:
Zhongwen Deng 2022-06-14 16:03:19 +08:00
parent fbfed35371
commit be7724b4e7
5 changed files with 22 additions and 26 deletions

1
.gitignore vendored
View File

@ -6,6 +6,7 @@ deps
*.o
*.beam
*.plt
*.example
erl_crash.dump
ebin
!ebin/.placeholder

View File

@ -9,20 +9,20 @@
## All configuration details can be found in emqx.conf.example
node {
name: "emqx@127.0.0.1"
cookie: emqxsecretcookie
data_dir: "{{ platform_data_dir }}"
etc_dir: "{{ platform_etc_dir }}"
name = "emqx@127.0.0.1"
cookie = emqxsecretcookie
data_dir = "{{ platform_data_dir }}"
etc_dir = "{{ platform_etc_dir }}"
}
log {
file_handlers.default {
level: warning
file: "{{ platform_log_dir }}/emqx.log"
level = warning
file = "{{ platform_log_dir }}/emqx.log"
}
}
cluster {
name: emqxcl
discovery_strategy: manual
name = emqxcl
discovery_strategy = manual
}

View File

@ -146,7 +146,7 @@ dump_schema(Dir, SchemaModule, I18nFile) ->
fun(Lang) ->
gen_config_md(Dir, I18nFile, SchemaModule, Lang),
gen_hot_conf_schema_json(Dir, I18nFile, Lang),
gen_example_conf(Dir, I18nFile, SchemaModule, Lang)
gen_example_conf(filename:dirname(I18nFile), I18nFile, SchemaModule, Lang)
end,
[en, zh]
),
@ -177,7 +177,7 @@ gen_config_md(Dir, I18nFile, SchemaModule, Lang0) ->
gen_example_conf(Dir, I18nFile, SchemaModule, Lang0) ->
Lang = atom_to_list(Lang0),
SchemaMdFile = filename:join([Dir, "emqx-" ++ Lang ++ ".conf.example"]),
SchemaMdFile = filename:join([Dir, "emqx.conf." ++ Lang ++ ".example"]),
io:format(user, "===< Generating: ~s~n", [SchemaMdFile]),
ok = gen_example(SchemaMdFile, SchemaModule, I18nFile, Lang).
@ -204,7 +204,12 @@ gen_doc(File, SchemaModule, I18nFile, Lang) ->
file:write_file(File, Doc).
gen_example(File, SchemaModule, I18nFile, Lang) ->
Opts = #{title => <<"Title">>, body => <<"Body">>, desc_file => I18nFile, lang => Lang},
Opts = #{
title => <<"EMQX Configuration Example">>,
body => <<"">>,
desc_file => I18nFile,
lang => Lang
},
Example = hocon_schema_example:gen(SchemaModule, Opts),
file:write_file(File, Example).

17
mix.exs
View File

@ -329,19 +329,10 @@ defmodule EMQXUmbrella.MixProject do
force: overwrite?
)
# copy generated docs
Enum.each(
[
"apps/emqx_dashboard/priv/www/static/emqx-en.conf.example",
"apps/emqx_dashboard/priv/www/static/emqx-zh.conf.example"
],
fn file ->
Mix.Generator.copy_file(
file,
Path.join(etc, Path.basename(file)),
force: overwrite?
)
end
Mix.Generator.copy_file(
"apps/emqx_dashboard/etc/emqx.conf.en.example",
Path.join(etc, "emqx-example-en.conf"),
force: overwrite?
)
# this is required by the produced escript / nodetool

View File

@ -395,8 +395,7 @@ etc_overlay(ReleaseType, Edition) ->
[
{mkdir, "etc/"},
{copy, "{{base_dir}}/lib/emqx/etc/certs", "etc/"},
{copy, "apps/emqx_dashboard/priv/www/static/emqx-en.conf.example", "etc/"},
{copy, "apps/emqx_dashboard/priv/www/static/emqx-zh.conf.example", "etc/"}
{copy, "apps/emqx_dashboard/etc/emqx.conf.en.example", "etc/emqx-example-en.conf"}
] ++
lists:map(
fun