Skip to content

Commit

Permalink
chore: no quic on centos7 and raspbian9 for now
Browse files Browse the repository at this point in the history
  • Loading branch information
zmstone committed Jun 26, 2022
1 parent 03f6124 commit e60fd0e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"

Expand Down
30 changes: 30 additions & 0 deletions get-emqtt-bench.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e60fd0e

Please sign in to comment.