|
|
@@ -15,19 +15,19 @@ set -euo pipefail
|
|
|
|
|
|
help() {
|
|
|
echo
|
|
|
- echo "-h|--help: To display this usage information"
|
|
|
- echo "--profile <PROFILE>: EMQX profile to build (emqx|emqx-edge|emqx-enterprise)"
|
|
|
- echo "--pkgtype tgz|pkg: Specify which package to build, tgz for .tar.gz,"
|
|
|
- echo " pkg for .rpm or .deb"
|
|
|
- echo "--with-elixir: Specify if the release should be built with Elixir, "
|
|
|
- echo " defaults to false."
|
|
|
- echo "--arch amd64|arm64: Target arch to build the EMQX package for"
|
|
|
- echo "--src_dir <SRC_DIR>: EMQX source ode in this dir, default to PWD"
|
|
|
- echo "--builder <BUILDER>: Builder image to pull"
|
|
|
- echo " E.g. ghcr.io/emqx/emqx-builder/5.0-7:1.13.3-24.2.1-1-debian10"
|
|
|
- echo "--otp <OTP_VSN>: OTP version being used in the builder"
|
|
|
- echo "--elixir <ELIXIR_VSN>: Elixir version being used in the builder"
|
|
|
- echo "--system <SYSTEM>: OS used in the builder image"
|
|
|
+ echo "-h|--help: To display this usage information"
|
|
|
+ echo "--profile <PROFILE>: EMQX profile to build (emqx|emqx-edge|emqx-enterprise)"
|
|
|
+ echo "--pkgtype tgz|pkg: Specify which package to build, tgz for .tar.gz,"
|
|
|
+ echo " pkg for .rpm or .deb"
|
|
|
+ echo "--elixir: Specify if the release should be built with Elixir, "
|
|
|
+ echo " defaults to 'no'."
|
|
|
+ echo "--arch amd64|arm64: Target arch to build the EMQX package for"
|
|
|
+ echo "--src_dir <SRC_DIR>: EMQX source ode in this dir, default to PWD"
|
|
|
+ echo "--builder <BUILDER>: Builder image to pull"
|
|
|
+ echo " E.g. ghcr.io/emqx/emqx-builder/5.0-7:1.13.3-24.2.1-1-debian10"
|
|
|
+ echo "--otp <OTP_VSN>: OTP version being used in the builder"
|
|
|
+ echo "--elixir-vsn <ELIXIR_VSN>: Elixir version being used in the builder"
|
|
|
+ echo "--system <SYSTEM>: OS used in the builder image"
|
|
|
}
|
|
|
|
|
|
while [ "$#" -gt 0 ]; do
|
|
|
@@ -60,13 +60,29 @@ while [ "$#" -gt 0 ]; do
|
|
|
OTP_VSN="$2"
|
|
|
shift 2
|
|
|
;;
|
|
|
- --elixir)
|
|
|
+ --elixir-vsn)
|
|
|
ELIXIR_VSN="$2"
|
|
|
shift 2
|
|
|
;;
|
|
|
- --with-elixir)
|
|
|
- WITH_ELIXIR=yes
|
|
|
+ --elixir)
|
|
|
shift 1
|
|
|
+ case ${1:-novalue} in
|
|
|
+ -*)
|
|
|
+ # another option
|
|
|
+ IS_ELIXIR='yes'
|
|
|
+ ;;
|
|
|
+ yes|no)
|
|
|
+ IS_ELIXIR="${1}"
|
|
|
+ shift 1
|
|
|
+ ;;
|
|
|
+ novalue)
|
|
|
+ IS_ELIXIR='yes'
|
|
|
+ ;;
|
|
|
+ *)
|
|
|
+ echo "ERROR: unknown option: --elixir $2"
|
|
|
+ exit 1
|
|
|
+ ;;
|
|
|
+ esac
|
|
|
;;
|
|
|
--system)
|
|
|
SYSTEM="$2"
|
|
|
@@ -96,8 +112,8 @@ cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")/.."
|
|
|
|
|
|
set -x
|
|
|
|
|
|
-if [ -z "${WITH_ELIXIR:-}" ]; then
|
|
|
- WITH_ELIXIR=no
|
|
|
+if [ -z "${IS_ELIXIR:-}" ]; then
|
|
|
+ IS_ELIXIR=no
|
|
|
fi
|
|
|
|
|
|
case "$PKGTYPE" in
|
|
|
@@ -113,20 +129,13 @@ esac
|
|
|
export CODE_PATH="${SRC_DIR:-$PWD}"
|
|
|
cd "${CODE_PATH}"
|
|
|
|
|
|
-PKG_VSN="${PKG_VSN:-$(./pkg-vsn.sh "$PROFILE")}"
|
|
|
-
|
|
|
-if [ "$WITH_ELIXIR" = "yes" ]; then
|
|
|
+if [ "$IS_ELIXIR" = "yes" ]; then
|
|
|
MAKE_TARGET="${PROFILE}-elixir-${PKGTYPE}"
|
|
|
else
|
|
|
MAKE_TARGET="${PROFILE}-${PKGTYPE}"
|
|
|
fi
|
|
|
|
|
|
-export WITH_ELIXIR
|
|
|
-export ELIXIR_VSN
|
|
|
-export PROFILE
|
|
|
-PKG_NAME="${PROFILE}-$(./scripts/pkg-full-vsn.sh "$PROFILE")"
|
|
|
-
|
|
|
-CMD_RUN="export EMQX_NAME=\"$PROFILE\"; make ${MAKE_TARGET} && ./scripts/pkg-tests.sh $PKG_NAME $PKGTYPE"
|
|
|
+CMD_RUN="make ${MAKE_TARGET} && ./scripts/pkg-tests.sh ${MAKE_TARGET}"
|
|
|
|
|
|
if [[ $(uname -m) = "x86_64" && "$ARCH" = "amd64" ]]; then
|
|
|
eval "$CMD_RUN"
|