Merge pull request #8810 from thalesmg/ci-fix-system-env-var

ci: pass down `$SYSTEM` for relup base versions escript
This commit is contained in:
Thales Macedo Garitezi 2022-08-25 15:27:51 -03:00 committed by GitHub
commit 987bce1c6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 0 deletions

View File

@ -84,6 +84,7 @@ jobs:
PYTHON: python PYTHON: python
DIAGNOSTIC: 1 DIAGNOSTIC: 1
PROFILE: emqx PROFILE: emqx
SYSTEM: windows
working-directory: source working-directory: source
run: | run: |
erl -eval "erlang:display(crypto:info_lib())" -s init stop erl -eval "erlang:display(crypto:info_lib())" -s init stop
@ -259,6 +260,7 @@ jobs:
--profile "${PROFILE}" \ --profile "${PROFILE}" \
--pkgtype "${PACKAGE}" \ --pkgtype "${PACKAGE}" \
--arch "${ARCH}" \ --arch "${ARCH}" \
--system "${SYSTEM}" \
--builder "ghcr.io/emqx/emqx-builder/4.4-19:${OTP}-${SYSTEM}" --builder "ghcr.io/emqx/emqx-builder/4.4-19:${OTP}-${SYSTEM}"
- uses: actions/upload-artifact@v1 - uses: actions/upload-artifact@v1
with: with:

View File

@ -79,6 +79,7 @@ jobs:
env: env:
PYTHON: python PYTHON: python
DIAGNOSTIC: 1 DIAGNOSTIC: 1
SYSTEM: windows
run: | run: |
erl -eval "erlang:display(crypto:info_lib())" -s init stop erl -eval "erlang:display(crypto:info_lib())" -s init stop
make ${{ matrix.profile }}-zip make ${{ matrix.profile }}-zip

View File

@ -20,6 +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 "--system <SYSTEM>: The target OS system the package is being built for, ex: debian11"
echo " E.g. ghcr.io/emqx/emqx-builder/4.4-19:24.1.5-3-debian10" echo " E.g. ghcr.io/emqx/emqx-builder/4.4-19:24.1.5-3-debian10"
} }
@ -49,6 +50,10 @@ while [ "$#" -gt 0 ]; do
ARCH="$2" ARCH="$2"
shift 2 shift 2
;; ;;
--system)
SYSTEM="$2"
shift 2
;;
*) *)
echo "WARN: Unknown arg (ignored): $1" echo "WARN: Unknown arg (ignored): $1"
shift shift
@ -70,6 +75,8 @@ fi
cd "${SRC_DIR:-.}" cd "${SRC_DIR:-.}"
set -x set -x
# $SYSTEM below is used by the `relup-base-vsns.escript` to correctly
# output the list of relup base versions.
docker info docker info
docker run --rm --privileged tonistiigi/binfmt:latest --install "${ARCH}" docker run --rm --privileged tonistiigi/binfmt:latest --install "${ARCH}"
docker run -i --rm \ docker run -i --rm \
@ -77,5 +84,6 @@ docker run -i --rm \
--workdir /emqx \ --workdir /emqx \
--platform="linux/$ARCH" \ --platform="linux/$ARCH" \
--user root \ --user root \
-e SYSTEM="$SYSTEM" \
"$BUILDER" \ "$BUILDER" \
bash -euc "git config --global --add safe.directory /emqx && chown -R root:root _build && make ${PROFILE}-${PKGTYPE} && .ci/build_packages/tests.sh $PROFILE $PKGTYPE" bash -euc "git config --global --add safe.directory /emqx && chown -R root:root _build && make ${PROFILE}-${PKGTYPE} && .ci/build_packages/tests.sh $PROFILE $PKGTYPE"

View File

@ -161,6 +161,9 @@ fetch_version(Vsn, VsnMap) ->
filter_froms(Froms0, AvailableVersionsIndex) -> filter_froms(Froms0, AvailableVersionsIndex) ->
Froms1 = Froms1 =
case os:getenv("SYSTEM") of case os:getenv("SYSTEM") of
%% we do not support relup for windows
"windows" ->
[];
%% debian11 is introduced since v4.4.2 and e4.4.2 %% debian11 is introduced since v4.4.2 and e4.4.2
%% exclude tags before them %% exclude tags before them
"debian11" -> "debian11" ->