diff --git a/build b/build index 890a9a1ff..e2c68bce1 100755 --- a/build +++ b/build @@ -188,8 +188,8 @@ make_zip() { esac ;; esac - ## one can only upgrade to 4.5.X from 4.4.8, when that's released. - ## Until that's released, there's no relup. + ## one can only upgrade to 4.5.X from 4.4.8 or later, when that's + ## released. Until that's released, there's no relup. if [[ -z "$(ls -A _upgrade_base 2>/dev/null || true)" && "${PKG_VSN}" == 4.5.0* ]]; then has_relup='no' fi diff --git a/include/emqx_release.hrl b/include/emqx_release.hrl index 439a6ac14..eed5fc0b2 100644 --- a/include/emqx_release.hrl +++ b/include/emqx_release.hrl @@ -29,7 +29,7 @@ -ifndef(EMQX_ENTERPRISE). --define(EMQX_RELEASE, {opensource, "4.5.0"}). +-define(EMQX_RELEASE, {opensource, "4.5.0-alpha.1"}). -else. diff --git a/scripts/relup-base-packages.sh b/scripts/relup-base-packages.sh index 5ac10ede2..f201a2dba 100755 --- a/scripts/relup-base-packages.sh +++ b/scripts/relup-base-packages.sh @@ -63,15 +63,21 @@ 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 +# 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 +otp_vsn_for() { + case "${1#[e|v]}" in + 4.4.*) + echo "24.1.5-3" + ;; + 4.5.*) + echo "$OTP_VSN" + ;; + esac +} for tag in $(../scripts/relup-base-vsns.sh $EDITION | xargs echo -n); do - filename="$PROFILE-${tag#[e|v]}-otp$OTP_VSN-$SYSTEM-$ARCH.zip" + filename="$PROFILE-${tag#[e|v]}-otp$(otp_vsn_for "$tag")-$SYSTEM-$ARCH.zip" url="https://packages.emqx.io/$DIR/$tag/$filename" if [ ! -f "$filename" ] && curl -L -I -m 10 -o /dev/null -s -w "%{http_code}" "${url}" | grep -q -oE "^[23]+" ; then echo "downloading base package from ${url} ..." diff --git a/scripts/relup-base-vsns.sh b/scripts/relup-base-vsns.sh index 724f17d1a..d8e9bf380 100755 --- a/scripts/relup-base-vsns.sh +++ b/scripts/relup-base-vsns.sh @@ -89,12 +89,20 @@ for tag_to_del in "${TAGS_EXCLUDE[@]}"; do TAGS=( "${TAGS[@]/$tag_to_del}" ) done -# 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 that allows upgrading to 4.4.5. +# 4.5.X versions uses the previous 4.4.Y as a base we emulate +# that we are the last 4.4.Y version that allows upgrading to 4.5.X # We add that version, if available. -if [[ "${CUR_SEMVER[0]}" = 4 && "${CUR_SEMVER[1]}" = 5 && "${CUR_SEMVER[2]}" = 0 ]]; then - [[ $(git tag -l "v4.4.8") ]] && TAGS+=( "v4.4.8" ) - [[ $(git tag -l "e4.4.8") ]] && TAGS+=( "e4.4.8" ) +maybe_add_tag() { + local tag="$1" + if [[ $(git tag -l "$tag") ]]; then + TAGS+=( "$tag" ) + fi +} + +if [[ "${CUR_SEMVER[0]}" = 4 && "${CUR_SEMVER[1]}" = 5 ]]; then + for tag in "v4.4.8" "e4.4.8"; do + maybe_add_tag "$tag" + done fi for tag in "${TAGS[@]}"; do