pre-compile.sh 999 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/usr/bin/env bash
  2. set -euo pipefail
  3. [ "${DEBUG:-0}" -eq 1 ] && set -x
  4. # NOTE: PROFILE_STR may not be exactly PROFILE (emqx or emqx-enterprise)
  5. # it might be with suffix such as -pkg etc.
  6. PROFILE_STR="${1}"
  7. case "$PROFILE_STR" in
  8. *enterprise*)
  9. dashboard_version="$EMQX_EE_DASHBOARD_VERSION"
  10. ;;
  11. *)
  12. dashboard_version="$EMQX_DASHBOARD_VERSION"
  13. ;;
  14. esac
  15. # ensure dir
  16. cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")/.."
  17. ./scripts/get-dashboard.sh "$dashboard_version"
  18. # generate merged config files and English translation of the desc (desc.en.hocon)
  19. ./scripts/merge-config.escript
  20. I18N_REPO_BRANCH="v$(./pkg-vsn.sh "${PROFILE_STR}" | tr -d '.' | cut -c 1-2)"
  21. # download desc (i18n) translations
  22. curl -L --silent --show-error \
  23. --output "apps/emqx_dashboard/priv/desc.zh.hocon" \
  24. "https://raw.githubusercontent.com/emqx/emqx-i18n/${I18N_REPO_BRANCH}/desc.zh.hocon"
  25. # TODO
  26. # make sbom a build artifcat
  27. # ./scripts/update-bom.sh "$PROFILE_STR" ./rel