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 *.o
*.beam *.beam
*.plt *.plt
*.example
erl_crash.dump erl_crash.dump
ebin ebin
!ebin/.placeholder !ebin/.placeholder

View File

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

View File

@ -146,7 +146,7 @@ dump_schema(Dir, SchemaModule, I18nFile) ->
fun(Lang) -> fun(Lang) ->
gen_config_md(Dir, I18nFile, SchemaModule, Lang), gen_config_md(Dir, I18nFile, SchemaModule, Lang),
gen_hot_conf_schema_json(Dir, I18nFile, 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, end,
[en, zh] [en, zh]
), ),
@ -177,7 +177,7 @@ gen_config_md(Dir, I18nFile, SchemaModule, Lang0) ->
gen_example_conf(Dir, I18nFile, SchemaModule, Lang0) -> gen_example_conf(Dir, I18nFile, SchemaModule, Lang0) ->
Lang = atom_to_list(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]), io:format(user, "===< Generating: ~s~n", [SchemaMdFile]),
ok = gen_example(SchemaMdFile, SchemaModule, I18nFile, Lang). ok = gen_example(SchemaMdFile, SchemaModule, I18nFile, Lang).
@ -204,7 +204,12 @@ gen_doc(File, SchemaModule, I18nFile, Lang) ->
file:write_file(File, Doc). file:write_file(File, Doc).
gen_example(File, SchemaModule, I18nFile, Lang) -> 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), Example = hocon_schema_example:gen(SchemaModule, Opts),
file:write_file(File, Example). file:write_file(File, Example).

13
mix.exs
View File

@ -329,20 +329,11 @@ defmodule EMQXUmbrella.MixProject do
force: overwrite? 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( Mix.Generator.copy_file(
file, "apps/emqx_dashboard/etc/emqx.conf.en.example",
Path.join(etc, Path.basename(file)), Path.join(etc, "emqx-example-en.conf"),
force: overwrite? force: overwrite?
) )
end
)
# this is required by the produced escript / nodetool # this is required by the produced escript / nodetool
Mix.Generator.copy_file( Mix.Generator.copy_file(

View File

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