From e60fd0ef1d6921b85709c8d22dbe43fe55641d94 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Fri, 24 Jun 2022 17:13:06 +0200 Subject: [PATCH] chore: no quic on centos7 and raspbian9 for now --- Dockerfile | 7 ++++--- get-emqtt-bench.sh | 30 ++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 3 deletions(-) create mode 100755 get-emqtt-bench.sh diff --git a/Dockerfile b/Dockerfile index 2a1601c..414046a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,8 @@ ARG BUILD_FROM=ubuntu:20.04 FROM ${BUILD_FROM} +ENV EMQX_BUILDER_IMAGE=${BUILD_FROM} + ARG OTP_VERSION COPY get-otp.sh /get-otp.sh @@ -14,10 +16,9 @@ RUN /get-elixir.sh ${ELIXIR_VERSION} RUN mkdir /tools ARG EMQTT_BENCH_REF -ENV EMQTT_BENCH_REF=${EMQTT_BENCH_REF:-0.4.5-alpha.1} -RUN git clone --depth=1 --branch=${EMQTT_BENCH_REF} https://github.com/emqx/emqtt-bench.git /tools/emqtt-bench \ - && make -C /tools/emqtt-bench +COPY get-emqtt-bench.sh /get-emqtt-bench.sh +RUN /get-emqtt-bench.sh "${EMQTT_BENCH_REF:-0.4.5-alpha.1}" ENV PATH="/tools/emqtt-bench:$PATH" diff --git a/get-emqtt-bench.sh b/get-emqtt-bench.sh new file mode 100755 index 0000000..f5402e8 --- /dev/null +++ b/get-emqtt-bench.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +set -xeuo pipefail + +VSN="$1" + +if grep -q -i 'rhel' /etc/os-release; then + DIST='el' + 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')" +fi +SYSTEM="$(echo "${DIST}${VERSION_ID}" | sed -r 's/([a-zA-Z]*)-.*/\1/g')" + +# no quic on raspbian9 and centos7 +case "$SYSTEM" in + *raspbian9*) + export BUILD_WITHOUT_QUIC=1 + ;; + *el7*) + export BUILD_WITHOUT_QUIC=1 + ;; + *) + true + ;; +esac + +git clone --depth=1 --branch="${VSN}" https://github.com/emqx/emqtt-bench.git /tools/emqtt-bench +make -C /tools/emqtt-bench