From 243b5564bedcf91cc3eadd68a92cf6a2504fdd8c Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Thu, 11 Jul 2024 16:27:46 +0900 Subject: [PATCH 1/2] packaing: test: centos7: Fix packaging test Signed-off-by: Hiroshi Hatake --- packaging/centos7-repo.sh | 4 ++++ packaging/test-release-packages.sh | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100755 packaging/centos7-repo.sh diff --git a/packaging/centos7-repo.sh b/packaging/centos7-repo.sh new file mode 100755 index 00000000000..28cd8c3fa6d --- /dev/null +++ b/packaging/centos7-repo.sh @@ -0,0 +1,4 @@ +#!bin/sh + +sed -i -e "s/^mirrorlist=http:\/\/mirrorlist.centos.org/#mirrorlist=http:\/\/mirrorlist.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo && \ +sed -i -e "s/^#baseurl=http:\/\/mirror.centos.org/baseurl=http:\/\/vault.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo diff --git a/packaging/test-release-packages.sh b/packaging/test-release-packages.sh index c72a3452965..e3c5961fba2 100755 --- a/packaging/test-release-packages.sh +++ b/packaging/test-release-packages.sh @@ -54,6 +54,20 @@ do echo "Testing $IMAGE" LOG_FILE=$(mktemp) + VAULT=0 + SCRIPT="" + # Fix to use Vault on CentOS 7 + case ${IMAGE} in + centos:7) + VAULT=1 + REPO_SCRIPT=$SCRIPT_DIR/centos7-repo.sh + REPO_SCRIPT_PATH=$(realpath "$REPO_SCRIPT") + EXTRA_MOUNTS="-v $REPO_SCRIPT_PATH:/centos7-repo.sh:ro $EXTRA_MOUNTS" + ;; + *) + ;; + esac + # We do want word splitting for EXTRA_MOUNTS # shellcheck disable=SC2086 $CONTAINER_RUNTIME run --rm -t \ @@ -65,7 +79,7 @@ do -e FLUENT_BIT_INSTALL_YUM_PARAMETERS="${FLUENT_BIT_INSTALL_YUM_PARAMETERS:-}" \ $EXTRA_MOUNTS \ "$IMAGE" \ - sh -c "$INSTALL_CMD && /opt/fluent-bit/bin/fluent-bit --version" | tee "$LOG_FILE" + sh -c "[ $VAULT -eq 1 ] && sh /centos7-repo.sh || true && $INSTALL_CMD && /opt/fluent-bit/bin/fluent-bit --version" | tee "$LOG_FILE" check_version "$LOG_FILE" rm -f "$LOG_FILE" done From 6cd9f854a135b4e67f8d8f698ae1bc37b0addeda Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Thu, 11 Jul 2024 17:26:58 +0900 Subject: [PATCH 2/2] packaging: test: Eliminate shellcheck errors Signed-off-by: Hiroshi Hatake --- packaging/centos7-repo.sh | 2 +- packaging/test-release-packages.sh | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packaging/centos7-repo.sh b/packaging/centos7-repo.sh index 28cd8c3fa6d..8dfd457e5b6 100755 --- a/packaging/centos7-repo.sh +++ b/packaging/centos7-repo.sh @@ -1,4 +1,4 @@ -#!bin/sh +#!/bin/sh sed -i -e "s/^mirrorlist=http:\/\/mirrorlist.centos.org/#mirrorlist=http:\/\/mirrorlist.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo && \ sed -i -e "s/^#baseurl=http:\/\/mirror.centos.org/baseurl=http:\/\/vault.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo diff --git a/packaging/test-release-packages.sh b/packaging/test-release-packages.sh index e3c5961fba2..085a3f205e8 100755 --- a/packaging/test-release-packages.sh +++ b/packaging/test-release-packages.sh @@ -55,7 +55,6 @@ do LOG_FILE=$(mktemp) VAULT=0 - SCRIPT="" # Fix to use Vault on CentOS 7 case ${IMAGE} in centos:7)