Skip to content

Commit

Permalink
install: update to fix AmazonLinux versions (#7354)
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Stephens <[email protected]>
  • Loading branch information
patrick-stephens authored May 12, 2023
1 parent 03c879f commit c65ced7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
9 changes: 4 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RELEASE_VERSION=${FLUENT_BIT_RELEASE_VERSION:-}
INSTALL_CMD_PREFIX=${FLUENT_BIT_INSTALL_COMMAND_PREFIX:-}
# Optionally set the name of th package to install, e.g. for legacy td-agent-bit.
INSTALL_PACKAGE_NAME=${FLUENT_BIT_INSTALL_PACKAGE_NAME:-fluent-bit}
# Optional Apt/Yum additional parameters (e.g. releasever for AL2022)
# Optional Apt/Yum additional parameters (e.g. releasever for AL2022/AL2023)
APT_PARAMETERS=${FLUENT_BIT_INSTALL_APT_PARAMETERS:-}
YUM_PARAMETERS=${FLUENT_BIT_INSTALL_YUM_PARAMETERS:-}

Expand Down Expand Up @@ -57,26 +57,25 @@ fi
# Will require sudo
case ${OS} in
amzn|amazonlinux)
# We need variable expansion and non-expansion on the URL line to pick up the base URL.
# Therefore we combine things with sed to handle it.
$SUDO sh <<SCRIPT
rpm --import $RELEASE_KEY
cat << EOF > /etc/yum.repos.d/fluent-bit.repo
[fluent-bit]
name = Fluent Bit
# Legacy server style
baseurl = $RELEASE_URL/amazonlinux/VERSION_SUBSTR
baseurl = $RELEASE_URL/amazonlinux/$VERSION
gpgcheck=1
repo_gpgcheck=1
gpgkey=$RELEASE_KEY
enabled=1
EOF
sed -i 's|VERSION_SUBSTR|\$releasever/|g' /etc/yum.repos.d/fluent-bit.repo
cat /etc/yum.repos.d/fluent-bit.repo
$INSTALL_CMD_PREFIX yum -y $YUM_PARAMETERS install $INSTALL_PACKAGE_NAME$YUM_VERSION
SCRIPT
;;
centos|centoslinux|rhel|redhatenterpriselinuxserver|fedora|rocky|almalinux)
# We need variable expansion and non-expansion on the URL line to pick up the base URL.
# Therefore we combine things with sed to handle it.
$SUDO sh <<SCRIPT
rpm --import $RELEASE_KEY
cat << EOF > /etc/yum.repos.d/fluent-bit.repo
Expand Down
8 changes: 1 addition & 7 deletions packaging/test-release-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,13 @@ do
echo "Testing $IMAGE"
LOG_FILE=$(mktemp)

UPDATED_FLUENT_BIT_INSTALL_COMMAND_PREFIX=${FLUENT_BIT_INSTALL_COMMAND_PREFIX:-}
# For AL2023 we currently want a fixed 2023 version instead of build timestamps
if [[ "$IMAGE" == "amazonlinux:2023" ]]; then
UPDATED_FLUENT_BIT_INSTALL_COMMAND_PREFIX="sed -i 's|\$releasever/|2023/|g' /etc/yum.repos.d/fluent-bit.repo;${FLUENT_BIT_INSTALL_COMMAND_PREFIX:-}"
fi

# We do want word splitting for EXTRA_MOUNTS
# shellcheck disable=SC2086
$CONTAINER_RUNTIME run --rm -t \
-e FLUENT_BIT_PACKAGES_URL="${FLUENT_BIT_PACKAGES_URL:-https://packages.fluentbit.io}" \
-e FLUENT_BIT_PACKAGES_KEY="${FLUENT_BIT_PACKAGES_KEY:-https://packages.fluentbit.io/fluentbit.key}" \
-e FLUENT_BIT_RELEASE_VERSION="${FLUENT_BIT_RELEASE_VERSION:-}" \
-e FLUENT_BIT_INSTALL_COMMAND_PREFIX="$UPDATED_FLUENT_BIT_INSTALL_COMMAND_PREFIX" \
-e FLUENT_BIT_INSTALL_COMMAND_PREFIX="${FLUENT_BIT_INSTALL_COMMAND_PREFIX:-}" \
-e FLUENT_BIT_INSTALL_PACKAGE_NAME="${FLUENT_BIT_INSTALL_PACKAGE_NAME:-fluent-bit}" \
-e FLUENT_BIT_INSTALL_YUM_PARAMETERS="${FLUENT_BIT_INSTALL_YUM_PARAMETERS:-}" \
$EXTRA_MOUNTS \
Expand Down

0 comments on commit c65ced7

Please sign in to comment.