diff --git a/build b/build index 024b9267d..056394bac 100755 --- a/build +++ b/build @@ -71,7 +71,14 @@ make_relup() { local lib_dir="_build/$PROFILE/rel/emqx/lib" local releases_dir="_build/$PROFILE/rel/emqx/releases" local name_pattern - name_pattern="${PROFILE}-$(./scripts/pkg-full-vsn.sh 'vsn_matcher')" + # 4.5.0 upgraded OTP from 24.1.5-3 to 24.3.4.2-1, so we need to + # fool the matcher to make it pick up the previous 4.4.X releases + # with older OTP. + if [[ "${PKG_VSN}" == 4.5.0* ]]; then + name_pattern="${PROFILE}-$(env OTP_VSN=24.1.5-3 ./scripts/pkg-full-vsn.sh 'vsn_matcher')" + else + name_pattern="${PROFILE}-$(./scripts/pkg-full-vsn.sh 'vsn_matcher')" + fi mkdir -p "$lib_dir" "$releases_dir" '_upgrade_base' local releases=() if [ -d "$releases_dir" ]; then @@ -96,8 +103,8 @@ make_relup() { fi RELX_BASE_VERSIONS="$(IFS=, ; echo "${releases[*]}")" export RELX_BASE_VERSIONS - if [[ ${PKG_VSN} == 4.3* ]]; then - echo "EMQX 4.3 specific, overwrite OTP app versions" + if [[ ${PKG_VSN} == 4.3* || ${PKG_VSN} == 4.5.0* ]]; then + echo "EMQX 4.3/4.5 specific, overwrite OTP app versions" local emqx_rel_file="${releases_dir}/${PKG_VSN}/emqx.rel" if [ ! -f "${emqx_rel_file}" ]; then ./rebar3 as "${PROFILE}" release @@ -115,7 +122,7 @@ make_relup() { # rollback rel file per releases # - if [[ ${PKG_VSN} == 4.3* ]]; then + if [[ ${PKG_VSN} == 4.3* || ${PKG_VSN} == 4.5.0* ]]; then echo "restore upgrade base rel files... " for rel in ${releases[*]}; do diff --git a/scripts/pkg-full-vsn.sh b/scripts/pkg-full-vsn.sh index e118643c9..752bb62e2 100755 --- a/scripts/pkg-full-vsn.sh +++ b/scripts/pkg-full-vsn.sh @@ -18,7 +18,7 @@ case "${VSN_MATCH}" in PKG_VSN='*' ;; *) - echo "$0 ERROR: second arg must " + echo "$0 ERROR: arg must be either 'vsn_exact' or 'vsn_matcher'" exit 1 ;; esac diff --git a/scripts/relup-base-packages.sh b/scripts/relup-base-packages.sh index 9505a68f0..5ac10ede2 100755 --- a/scripts/relup-base-packages.sh +++ b/scripts/relup-base-packages.sh @@ -63,6 +63,13 @@ cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")/.." mkdir -p _upgrade_base pushd _upgrade_base +# For 4.5, we upgrade from OTP 24.1.5-3 to 24.3.4.2-1, so we must manually +# check the old OTP releases. +CURRENT_VERSION="$(../pkg-vsn.sh)" +if [[ "${CURRENT_VERSION}" = 4.5.0* ]]; then + OTP_VSN=24.1.5-3 +fi + for tag in $(../scripts/relup-base-vsns.sh $EDITION | xargs echo -n); do filename="$PROFILE-${tag#[e|v]}-otp$OTP_VSN-$SYSTEM-$ARCH.zip" url="https://packages.emqx.io/$DIR/$tag/$filename" diff --git a/scripts/relup-base-vsns.sh b/scripts/relup-base-vsns.sh index 91c26823e..6b35fb196 100755 --- a/scripts/relup-base-vsns.sh +++ b/scripts/relup-base-vsns.sh @@ -61,6 +61,14 @@ esac # must not be empty for MacOS (bash 3.x) TAGS=( 'dummy' ) TAGS_EXCLUDE=( 'dummy' ) + +# first 4.5.0 version uses the previous 4.4.X as a base +# we emulate that we are the last 4.4.X version. +if [[ "${CUR_SEMVER[0]}" = 4 && "${CUR_SEMVER[1]}" = 5 && "${CUR_SEMVER[2]}" = 0 ]]; then + CUR_SEMVER[1]=4 + CUR_SEMVER[2]=9999 +fi + while read -r git_tag; do # shellcheck disable=SC2207 semver=($(parse_semver "$git_tag"))