chore(build): directly generate doc from build script
This commit is contained in:
parent
01ce32094c
commit
9430f70dd8
18
build
18
build
|
@ -63,16 +63,24 @@ log() {
|
||||||
}
|
}
|
||||||
|
|
||||||
docgen() {
|
docgen() {
|
||||||
local conf_doc
|
local conf_doc_html libs_dir1 libs_dir2
|
||||||
conf_doc="$(pwd)/_build/${PROFILE}/rel/emqx/etc/emqx-config-doc.html"
|
conf_doc_html="$(pwd)/_build/${PROFILE}/rel/emqx/etc/emqx-config-doc.html"
|
||||||
echo "===< Generating config document $conf_doc"
|
echo "===< Generating config document $conf_doc_html"
|
||||||
./_build/"$PROFILE"/rel/emqx/bin/emqx cold_eval "file:write_file('$conf_doc', hocon_schema_html:gen(emqx_machine_schema, \"EMQ X ${PKG_VSN}\"))"
|
libs_dir1="$(find "_build/default/lib/" -maxdepth 2 -name ebin -type d)"
|
||||||
|
libs_dir2="$(find "_build/$PROFILE/lib/" -maxdepth 2 -name ebin -type d)"
|
||||||
|
# shellcheck disable=SC2086
|
||||||
|
erl -noshell -pa $libs_dir1 $libs_dir2 -eval "file:write_file('$conf_doc_html', hocon_schema_html:gen(emqx_machine_schema, \"EMQ X ${PKG_VSN}\")), halt(0)."
|
||||||
|
local conf_doc_markdown
|
||||||
|
conf_doc_markdown="$(pwd)/_build/${PROFILE}/rel/emqx/etc/emqx-config-doc.md"
|
||||||
|
echo "===< Generating config document $conf_doc_markdown"
|
||||||
|
# shellcheck disable=SC2086
|
||||||
|
erl -noshell -pa $libs_dir1 $libs_dir2 -eval "file:write_file('$conf_doc_markdown', hocon_schema_doc:gen(emqx_machine_schema)), halt(0)."
|
||||||
}
|
}
|
||||||
|
|
||||||
make_rel() {
|
make_rel() {
|
||||||
# shellcheck disable=SC1010
|
# shellcheck disable=SC1010
|
||||||
./rebar3 as "$PROFILE" do release,tar
|
./rebar3 as "$PROFILE" do release,tar
|
||||||
if [ "$(find "_build/$PROFILE/rel/emqx/lib/" -name 'gpb-*' -type d)" != "" ]; then
|
if [ "$(find "_build/$PROFILE/rel/emqx/lib/" -maxdepth 1 -name 'gpb-*' -type d)" != "" ]; then
|
||||||
echo "gpb should not be included in the release"
|
echo "gpb should not be included in the release"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue