diff --git a/packaging/centos7-repo.sh b/packaging/centos7-repo.sh new file mode 100755 index 00000000000..8dfd457e5b6 --- /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..085a3f205e8 100755 --- a/packaging/test-release-packages.sh +++ b/packaging/test-release-packages.sh @@ -54,6 +54,19 @@ do echo "Testing $IMAGE" LOG_FILE=$(mktemp) + VAULT=0 + # 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 +78,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