build: do not generate desc.en.hocon if jq command is not found
This commit is contained in:
parent
5990f9835f
commit
fd205f599c
19
build
19
build
|
@ -12,6 +12,12 @@ if [ "${DEBUG:-0}" -eq 1 ]; then
|
||||||
export DIAGNOSTIC=1
|
export DIAGNOSTIC=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
log_red() {
|
||||||
|
local RED='\033[0;31m' # Red
|
||||||
|
local NC='\033[0m' # No Color
|
||||||
|
echo -e "${RED}${1}${NC}"
|
||||||
|
}
|
||||||
|
|
||||||
PROFILE_ARG="$1"
|
PROFILE_ARG="$1"
|
||||||
ARTIFACT="$2"
|
ARTIFACT="$2"
|
||||||
|
|
||||||
|
@ -34,7 +40,7 @@ case "$(is_enterprise "$PROFILE_ARG"),$(is_enterprise "$PROFILE_ENV")" in
|
||||||
true
|
true
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "PROFILE env var is set to '$PROFILE_ENV', but '$0' arg1 is '$PROFILE_ARG'"
|
log_red "PROFILE env var is set to '$PROFILE_ENV', but '$0' arg1 is '$PROFILE_ARG'"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -134,8 +140,13 @@ make_docs() {
|
||||||
"ok = emqx_conf:dump_schema('$docdir', $SCHEMA_MODULE), \
|
"ok = emqx_conf:dump_schema('$docdir', $SCHEMA_MODULE), \
|
||||||
halt(0)."
|
halt(0)."
|
||||||
local desc="$docdir/desc.en.hocon"
|
local desc="$docdir/desc.en.hocon"
|
||||||
|
if command -v jq &> /dev/null; then
|
||||||
log "Generating $desc"
|
log "Generating $desc"
|
||||||
scripts/merge-i18n.escript | jq --sort-keys . > "$desc"
|
scripts/merge-i18n.escript | jq --sort-keys . > "$desc"
|
||||||
|
else
|
||||||
|
# it is not a big deal if we cannot generate the desc
|
||||||
|
log_red "NOT Generated: $desc"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
## arg1 is the profile for which the following args (as app names) should be excluded
|
## arg1 is the profile for which the following args (as app names) should be excluded
|
||||||
|
@ -152,8 +163,8 @@ assert_no_excluded_deps() {
|
||||||
for app in "${excluded_apps[@]}"; do
|
for app in "${excluded_apps[@]}"; do
|
||||||
found="$($FIND "$rel_dir" -maxdepth 1 -type d -name "$app-*")"
|
found="$($FIND "$rel_dir" -maxdepth 1 -type d -name "$app-*")"
|
||||||
if [ -n "${found}" ]; then
|
if [ -n "${found}" ]; then
|
||||||
echo "ERROR: ${app} should not be included in ${PROFILE}"
|
log_red "ERROR: ${app} should not be included in ${PROFILE}"
|
||||||
echo "ERROR: found ${app} in ${rel_dir}"
|
log_red "ERROR: found ${app} in ${rel_dir}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
@ -294,7 +305,7 @@ make_tgz() {
|
||||||
mkdir -p "${tard}/emqx"
|
mkdir -p "${tard}/emqx"
|
||||||
mkdir -p "${pkgpath}"
|
mkdir -p "${pkgpath}"
|
||||||
if [ ! -f "$src_tarball" ]; then
|
if [ ! -f "$src_tarball" ]; then
|
||||||
log "ERROR: $src_tarball is not found"
|
log_red "ERROR: $src_tarball is not found"
|
||||||
fi
|
fi
|
||||||
$TAR zxf "${src_tarball}" -C "${tard}/emqx"
|
$TAR zxf "${src_tarball}" -C "${tard}/emqx"
|
||||||
if [ -f "${tard}/emqx/releases/${PKG_VSN}/relup" ]; then
|
if [ -f "${tard}/emqx/releases/${PKG_VSN}/relup" ]; then
|
||||||
|
|
Loading…
Reference in New Issue