Skip to content

Commit

Permalink
packaing: test: centos7: Fix packaging test (#9076)
Browse files Browse the repository at this point in the history
* packaing: test: centos7: Fix packaging test

Signed-off-by: Hiroshi Hatake <[email protected]>

* packaging: test: Eliminate shellcheck errors

Signed-off-by: Hiroshi Hatake <[email protected]>

---------

Signed-off-by: Hiroshi Hatake <[email protected]>
  • Loading branch information
cosmo0920 authored Jul 11, 2024
1 parent c71cad2 commit dfd1572
Show file tree
Hide file tree
Showing 2 changed files with 18 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
15 changes: 14 additions & 1 deletion packaging/test-release-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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
Expand Down

0 comments on commit dfd1572

Please sign in to comment.