Skip to content

Commit

Permalink
packaing: test: centos7: Fix packaging test
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
  • Loading branch information
cosmo0920 committed Jul 11, 2024
1 parent c71cad2 commit 243b556
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packaging/centos7-repo.sh
Original file line number Diff line number Diff line change
@@ -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
16 changes: 15 additions & 1 deletion packaging/test-release-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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
Expand Down

0 comments on commit 243b556

Please sign in to comment.