Merge pull request #6955 from emqx/build-rename-centos-to-rhel

build: rename centos to rhel
This commit is contained in:
Shawn 2022-02-10 09:33:06 +08:00 committed by GitHub
commit 647bcce760
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 38 additions and 34 deletions

View File

@ -1,4 +1,4 @@
ARG BUILD_FROM=ghcr.io/emqx/emqx-builder/4.4-4:24.1.5-3-ubuntu20.04 ARG BUILD_FROM=ghcr.io/emqx/emqx-builder/4.4-5:24.1.5-3-ubuntu20.04
FROM ${BUILD_FROM} FROM ${BUILD_FROM}
ARG EMQX_NAME=emqx ARG EMQX_NAME=emqx

View File

@ -3,7 +3,7 @@ version: '3.9'
services: services:
erlang: erlang:
container_name: erlang container_name: erlang
image: ghcr.io/emqx/emqx-builder/4.4-4:24.1.5-3-ubuntu20.04 image: ghcr.io/emqx/emqx-builder/4.4-5:24.1.5-3-ubuntu20.04
env_file: env_file:
- conf.env - conf.env
environment: environment:

View File

@ -16,7 +16,7 @@ jobs:
prepare: prepare:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
# prepare source with any OTP version, no need for a matrix # prepare source with any OTP version, no need for a matrix
container: ghcr.io/emqx/emqx-builder/4.4-4:24.1.5-3-ubuntu20.04 container: ghcr.io/emqx/emqx-builder/4.4-5:24.1.5-3-ubuntu20.04
outputs: outputs:
profiles: ${{ steps.set_profile.outputs.profiles }} profiles: ${{ steps.set_profile.outputs.profiles }}
@ -240,17 +240,12 @@ jobs:
- ubuntu16.04 - ubuntu16.04
- debian10 - debian10
- debian9 - debian9
# - opensuse - rockylinux8
- centos8
- centos7 - centos7
- centos6
- raspbian10 - raspbian10
# - raspbian9
exclude: exclude:
- package: pkg - package: pkg
otp: 23.3.4.9-3 otp: 23.3.4.9-3
- os: centos6
arch: arm64
- os: raspbian9 - os: raspbian9
arch: amd64 arch: amd64
- os: raspbian10 - os: raspbian10
@ -298,12 +293,18 @@ jobs:
if [ ! -z "$(echo $SYSTEM | grep -oE 'raspbian')" ]; then if [ ! -z "$(echo $SYSTEM | grep -oE 'raspbian')" ]; then
export ARCH="arm" export ARCH="arm"
fi fi
if [ "$SYSTEM" = 'centos7' ]; then
DISTRO='rhel7'
elif [ "$SYSTEM" = 'rockylinux8' ]; then
DISTRO='rhel8'
else
DISTRO=${SYSTEM}
fi
mkdir -p _upgrade_base mkdir -p _upgrade_base
cd _upgrade_base cd _upgrade_base
old_vsns=($(echo $OLD_VSNS | tr ' ' ' ')) old_vsns=($(echo $OLD_VSNS | tr ' ' ' '))
for tag in ${old_vsns[@]}; do 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 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
wget --no-verbose https://s3-us-west-2.amazonaws.com/packages.emqx/$broker/$tag/$package_name.zip.sha256 wget --no-verbose https://s3-us-west-2.amazonaws.com/packages.emqx/$broker/$tag/$package_name.zip.sha256
@ -323,7 +324,7 @@ jobs:
--profile "${PROFILE}" \ --profile "${PROFILE}" \
--pkgtype "${PACKAGE}" \ --pkgtype "${PACKAGE}" \
--arch "${ARCH}" \ --arch "${ARCH}" \
--builder "ghcr.io/emqx/emqx-builder/4.4-4:${OTP}-${SYSTEM}" --builder "ghcr.io/emqx/emqx-builder/4.4-5:${OTP}-${SYSTEM}"
- name: create sha256 - name: create sha256
working-directory: source working-directory: source
env: env:
@ -392,7 +393,7 @@ jobs:
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
build-args: | build-args: |
BUILD_FROM=ghcr.io/emqx/emqx-builder/4.4-4:${{ matrix.otp }}-alpine3.14 BUILD_FROM=ghcr.io/emqx/emqx-builder/4.4-5:${{ matrix.otp }}-alpine3.14
RUN_FROM=alpine:3.14 RUN_FROM=alpine:3.14
EMQX_NAME=${{ matrix.profile }} EMQX_NAME=${{ matrix.profile }}
file: source/deploy/docker/Dockerfile file: source/deploy/docker/Dockerfile
@ -407,7 +408,7 @@ jobs:
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
build-args: | build-args: |
BUILD_FROM=ghcr.io/emqx/emqx-builder/4.4-4:${{ matrix.otp }}-alpine3.14 BUILD_FROM=ghcr.io/emqx/emqx-builder/4.4-5:${{ matrix.otp }}-alpine3.14
RUN_FROM=alpine:3.14 RUN_FROM=alpine:3.14
EMQX_NAME=${{ matrix.profile }} EMQX_NAME=${{ matrix.profile }}
file: source/deploy/docker/Dockerfile.enterprise file: source/deploy/docker/Dockerfile.enterprise

View File

@ -25,9 +25,9 @@ jobs:
- 24.1.5-3 - 24.1.5-3
os: os:
- ubuntu20.04 - ubuntu20.04
- centos7 - rockylinux8
container: ghcr.io/emqx/emqx-builder/4.4-4:${{ matrix.erl_otp }}-${{ matrix.os }} container: ghcr.io/emqx/emqx-builder/4.4-5:${{ matrix.erl_otp }}-${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
@ -53,7 +53,8 @@ jobs:
- name: packages test - name: packages test
run: | run: |
PKG_VSN="$(./pkg-vsn.sh)" PKG_VSN="$(./pkg-vsn.sh)"
PKG_NAME="${EMQX_NAME}-${PKG_VSN}-otp${{ matrix.erl_otp }}-${{ matrix.os }}-amd64" DISTRO="$(./scripts/get-distro.sh)"
PKG_NAME="${EMQX_NAME}-${PKG_VSN}-otp${{ matrix.erl_otp }}-${DISTRO}-amd64"
export CODE_PATH="$GITHUB_WORKSPACE" export CODE_PATH="$GITHUB_WORKSPACE"
.ci/build_packages/tests.sh "$PKG_NAME" zip .ci/build_packages/tests.sh "$PKG_NAME" zip
.ci/build_packages/tests.sh "$PKG_NAME" pkg .ci/build_packages/tests.sh "$PKG_NAME" pkg

View File

@ -5,7 +5,7 @@ on: [pull_request]
jobs: jobs:
check_deps_integrity: check_deps_integrity:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
container: ghcr.io/emqx/emqx-builder/4.4-4:24.1.5-3-ubuntu20.04 container: ghcr.io/emqx/emqx-builder/4.4-5:24.1.5-3-ubuntu20.04
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2

View File

@ -5,7 +5,7 @@ on: workflow_dispatch
jobs: jobs:
test: test:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
container: ghcr.io/emqx/emqx-builder/4.4-4:24.1.5-3-ubuntu20.04 container: ghcr.io/emqx/emqx-builder/4.4-5:24.1.5-3-ubuntu20.04
strategy: strategy:
fail-fast: true fail-fast: true
env: env:

View File

@ -226,7 +226,7 @@ jobs:
relup_test_plan: relup_test_plan:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
container: ghcr.io/emqx/emqx-builder/4.4-4:24.1.5-3-ubuntu20.04 container: ghcr.io/emqx/emqx-builder/4.4-5:24.1.5-3-ubuntu20.04
outputs: outputs:
profile: ${{ steps.profile-and-versions.outputs.profile }} profile: ${{ steps.profile-and-versions.outputs.profile }}
vsn: ${{ steps.profile-and-versions.outputs.vsn }} vsn: ${{ steps.profile-and-versions.outputs.vsn }}
@ -277,7 +277,7 @@ jobs:
otp: otp:
- 24.1.5-3 - 24.1.5-3
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
container: ghcr.io/emqx/emqx-builder/4.4-4:24.1.5-3-ubuntu20.04 container: ghcr.io/emqx/emqx-builder/4.4-5:24.1.5-3-ubuntu20.04
defaults: defaults:
run: run:
shell: bash shell: bash

View File

@ -10,7 +10,7 @@ on:
jobs: jobs:
run_proper_test: run_proper_test:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
container: ghcr.io/emqx/emqx-builder/4.4-4:24.1.5-3-ubuntu20.04 container: ghcr.io/emqx/emqx-builder/4.4-5:24.1.5-3-ubuntu20.04
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2

View File

@ -2,7 +2,7 @@ $(shell $(CURDIR)/scripts/git-hooks-init.sh)
REBAR = $(CURDIR)/rebar3 REBAR = $(CURDIR)/rebar3
BUILD = $(CURDIR)/build BUILD = $(CURDIR)/build
SCRIPTS = $(CURDIR)/scripts SCRIPTS = $(CURDIR)/scripts
export EMQX_DEFAULT_BUILDER = ghcr.io/emqx/emqx-builder/4.4-4:24.1.5-3-alpine3.14 export EMQX_DEFAULT_BUILDER = ghcr.io/emqx/emqx-builder/4.4-5:24.1.5-3-alpine3.14
export EMQX_DEFAULT_RUNNER = alpine:3.14 export EMQX_DEFAULT_RUNNER = alpine:3.14
export OTP_VSN ?= $(shell $(CURDIR)/scripts/get-otp-vsn.sh) export OTP_VSN ?= $(shell $(CURDIR)/scripts/get-otp-vsn.sh)
export PKG_VSN ?= $(shell $(CURDIR)/pkg-vsn.sh) export PKG_VSN ?= $(shell $(CURDIR)/pkg-vsn.sh)

6
build
View File

@ -150,7 +150,7 @@ make_docker() {
## Name Default Example ## Name Default Example
## --------------------------------------------------------------------- ## ---------------------------------------------------------------------
## EMQX_BASE_IMAGE current os centos:7 ## EMQX_BASE_IMAGE current os centos:7
## EMQX_ZIP_PACKAGE _packages/<current-zip-target> /tmp/emqx-4.4.0-otp24.1.5-3-centos7-amd64.zip ## EMQX_ZIP_PACKAGE _packages/<current-zip-target> /tmp/emqx-4.4.0-otp24.1.5-3-rhel7-amd64.zip
## EMQX_IMAGE_TAG emqx/emqx:<current-vns-rel> emqx/emqx:testing-tag ## EMQX_IMAGE_TAG emqx/emqx:<current-vns-rel> emqx/emqx:testing-tag
## ##
make_docker_testing() { make_docker_testing() {
@ -159,8 +159,8 @@ make_docker_testing() {
ubuntu20*) ubuntu20*)
EMQX_BASE_IMAGE="ubuntu:20.04" EMQX_BASE_IMAGE="ubuntu:20.04"
;; ;;
centos8) rhel8)
EMQX_BASE_IMAGE="centos:8" EMQX_BASE_IMAGE="rockylinux:8"
;; ;;
*) *)
echo "Unsupported testing base image for $SYSTEM" echo "Unsupported testing base image for $SYSTEM"

View File

@ -1,4 +1,4 @@
ARG BUILD_FROM=ghcr.io/emqx/emqx-builder/4.4-4:24.1.5-3-alpine3.14 ARG BUILD_FROM=ghcr.io/emqx/emqx-builder/4.4-5:24.1.5-3-alpine3.14
ARG RUN_FROM=alpine:3.14 ARG RUN_FROM=alpine:3.14
FROM ${BUILD_FROM} AS builder FROM ${BUILD_FROM} AS builder

View File

@ -8,7 +8,7 @@
## i.e. will not work if docker command has to be executed with sudo ## i.e. will not work if docker command has to be executed with sudo
## example: ## example:
## ./scripts/buildx.sh --profile emqx --pkgtype zip --builder ghcr.io/emqx/emqx-builder/4.4-4:24.1.5-3-debian10 --arch arm64 ## ./scripts/buildx.sh --profile emqx --pkgtype zip --builder ghcr.io/emqx/emqx-builder/4.4-5:24.1.5-3-debian10 --arch arm64
set -euo pipefail set -euo pipefail
@ -20,7 +20,7 @@ help() {
echo "--arch amd64|arm64: Target arch to build the EMQ X package for" echo "--arch amd64|arm64: Target arch to build the EMQ X package for"
echo "--src_dir <SRC_DIR>: EMQ X source ode in this dir, default to PWD" echo "--src_dir <SRC_DIR>: EMQ X source ode in this dir, default to PWD"
echo "--builder <BUILDER>: Builder image to pull" echo "--builder <BUILDER>: Builder image to pull"
echo " E.g. ghcr.io/emqx/emqx-builder/4.4-4:24.1.5-3-debian10" echo " E.g. ghcr.io/emqx/emqx-builder/4.4-5:24.1.5-3-debian10"
} }
while [ "$#" -gt 0 ]; do while [ "$#" -gt 0 ]; do
@ -69,9 +69,11 @@ fi
cd "${SRC_DIR:-.}" cd "${SRC_DIR:-.}"
set -x
PKG_VSN="${PKG_VSN:-$(./pkg-vsn.sh)}" PKG_VSN="${PKG_VSN:-$(./pkg-vsn.sh)}"
OTP_VSN_SYSTEM=$(echo "$BUILDER" | cut -d ':' -f2) OTP_VSN="$(docker run -v $(pwd):/src --rm "$BUILDER" bash /src/scripts/get-otp-vsn.sh)"
PKG_NAME="${PROFILE}-${PKG_VSN}-otp${OTP_VSN_SYSTEM}-${ARCH}" 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 info
docker run --rm --privileged tonistiigi/binfmt:latest --install ${ARCH} docker run --rm --privileged tonistiigi/binfmt:latest --install ${ARCH}

View File

@ -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') 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')" SYSTEM="$(echo "${DIST}${VERSION_ID}" | gsed -r 's/([a-zA-Z]*)-.*/\1/g')"
elif [ "$(uname -s)" = 'Linux' ]; then elif [ "$(uname -s)" = 'Linux' ]; then
if grep -q -i 'centos' /etc/*-release; then if grep -q -i 'rhel' /etc/*-release; then
DIST='centos' DIST='rhel'
VERSION_ID="$(rpm --eval '%{centos_ver}')" VERSION_ID="$(rpm --eval '%{rhel}')"
else else
DIST="$(sed -n '/^ID=/p' /etc/os-release | sed -r 's/ID=(.*)/\1/g' | sed 's/"//g')" 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')" VERSION_ID="$(sed -n '/^VERSION_ID=/p' /etc/os-release | sed -r 's/VERSION_ID=(.*)/\1/g' | sed 's/"//g')"