diff --git a/.github/workflows/build_packages.yaml b/.github/workflows/build_packages.yaml index c5b734f56..cf5f5b902 100644 --- a/.github/workflows/build_packages.yaml +++ b/.github/workflows/build_packages.yaml @@ -240,17 +240,12 @@ jobs: - ubuntu16.04 - debian10 - debian9 - # - opensuse - - centos8 + - rockylinux8 - centos7 - - centos6 - raspbian10 - # - raspbian9 exclude: - package: pkg otp: 23.3.4.9-3 - - os: centos6 - arch: arm64 - os: raspbian9 arch: amd64 - os: raspbian10 @@ -298,12 +293,18 @@ jobs: if [ ! -z "$(echo $SYSTEM | grep -oE 'raspbian')" ]; then export ARCH="arm" fi - + if [ "$SYSTEM" = 'centos7' ]; then + DISTRO='rhel7' + elif [ "$SYSTEM" = 'rockylinux8' ]; then + DISTRO='rhel8' + else + DISTRO=${SYSTEM} + fi mkdir -p _upgrade_base cd _upgrade_base old_vsns=($(echo $OLD_VSNS | tr ' ' ' ')) for tag in ${old_vsns[@]}; do - package_name="${PROFILE}-${tag#[e|v]}-otp${OTP_VSN}-${SYSTEM}-${ARCH}" + package_name="${PROFILE}-${tag#[e|v]}-otp${OTP_VSN}-${DISTRO}-${ARCH}" if [ ! -z "$(echo $(curl -I -m 10 -o /dev/null -s -w %{http_code} https://s3-us-west-2.amazonaws.com/packages.emqx/$broker/$tag/$package_name.zip) | grep -oE "^[23]+")" ]; then wget --no-verbose https://s3-us-west-2.amazonaws.com/packages.emqx/$broker/$tag/$package_name.zip wget --no-verbose https://s3-us-west-2.amazonaws.com/packages.emqx/$broker/$tag/$package_name.zip.sha256 diff --git a/build b/build index 7b5e6645e..3d5d3b265 100755 --- a/build +++ b/build @@ -150,7 +150,7 @@ make_docker() { ## Name Default Example ## --------------------------------------------------------------------- ## EMQX_BASE_IMAGE current os centos:7 -## EMQX_ZIP_PACKAGE _packages/ /tmp/emqx-4.4.0-otp24.1.5-3-centos7-amd64.zip +## EMQX_ZIP_PACKAGE _packages/ /tmp/emqx-4.4.0-otp24.1.5-3-rhel7-amd64.zip ## EMQX_IMAGE_TAG emqx/emqx: emqx/emqx:testing-tag ## make_docker_testing() { @@ -159,8 +159,8 @@ make_docker_testing() { ubuntu20*) EMQX_BASE_IMAGE="ubuntu:20.04" ;; - centos8) - EMQX_BASE_IMAGE="centos:8" + rhel8) + EMQX_BASE_IMAGE="rockylinux:8" ;; *) echo "Unsupported testing base image for $SYSTEM" diff --git a/scripts/buildx.sh b/scripts/buildx.sh index 6e3ef8160..e9ebcf6e1 100755 --- a/scripts/buildx.sh +++ b/scripts/buildx.sh @@ -69,9 +69,11 @@ fi cd "${SRC_DIR:-.}" +set -x PKG_VSN="${PKG_VSN:-$(./pkg-vsn.sh)}" -OTP_VSN_SYSTEM=$(echo "$BUILDER" | cut -d ':' -f2) -PKG_NAME="${PROFILE}-${PKG_VSN}-otp${OTP_VSN_SYSTEM}-${ARCH}" +OTP_VSN="$(docker run -v $(pwd):/src --rm "$BUILDER" bash /src/scripts/get-otp-vsn.sh)" +DISTRO="$(docker run -v $(pwd):/src --rm "$BUILDER" bash /src/scripts/get-distro.sh)" +PKG_NAME="${PROFILE}-${PKG_VSN}-otp${OTP_VSN}-${DISTRO}-${ARCH}" docker info docker run --rm --privileged tonistiigi/binfmt:latest --install ${ARCH} diff --git a/scripts/get-distro.sh b/scripts/get-distro.sh index 89eafc4ee..c28698af1 100755 --- a/scripts/get-distro.sh +++ b/scripts/get-distro.sh @@ -10,9 +10,9 @@ if [ "$(uname -s)" = 'Darwin' ]; then VERSION_ID=$(sw_vers | gsed -n '/^ProductVersion:/p' | gsed -r 's/ProductVersion:(.*)/\1/g' | gsed -r 's/([0-9]+).*/\1/g' | gsed 's/^[ \t]*//g') SYSTEM="$(echo "${DIST}${VERSION_ID}" | gsed -r 's/([a-zA-Z]*)-.*/\1/g')" elif [ "$(uname -s)" = 'Linux' ]; then - if grep -q -i 'centos' /etc/*-release; then - DIST='centos' - VERSION_ID="$(rpm --eval '%{centos_ver}')" + if grep -q -i 'rhel' /etc/*-release; then + DIST='rhel' + VERSION_ID="$(rpm --eval '%{rhel}')" else DIST="$(sed -n '/^ID=/p' /etc/os-release | sed -r 's/ID=(.*)/\1/g' | sed 's/"//g')" VERSION_ID="$(sed -n '/^VERSION_ID=/p' /etc/os-release | sed -r 's/VERSION_ID=(.*)/\1/g' | sed 's/"//g')"