Skip to content

Commit

Permalink
packaging: handle parameters separate from command for word splitting (
Browse files Browse the repository at this point in the history
…fluent#6224)

Signed-off-by: Patrick Stephens <[email protected]>

Signed-off-by: Patrick Stephens <[email protected]>
Signed-off-by: root <[email protected]>
  • Loading branch information
patrick-stephens authored and root committed Feb 8, 2023
1 parent 19a7d9c commit 7988ec6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
21 changes: 11 additions & 10 deletions packaging/server/publish-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ fi

# Handle Ubuntu 18/22 differences - no support on Ubuntu 20
CREATE_REPO_CMD=${CREATE_REPO_CMD:-}
CREATE_REPO_ARGS=${CREATE_REPO_ARGS:--dvp}

# Assume if set we want to use it
if [[ -n "$CREATE_REPO_CMD" ]]; then
Expand All @@ -46,44 +47,44 @@ if [[ -d "$SOURCE_DIR/amazonlinux/2022/" ]]; then
echo "Publishing AmazonLinux 2022"
mkdir -p /var/www/apt.fluentbit.io/amazonlinux/2022/x86_64 /var/www/apt.fluentbit.io/amazonlinux/2022/aarch64
find "$SOURCE_DIR/amazonlinux/2022" -iname "*-bit-$VERSION-*x86_64*.rpm" -exec cp -fv {} "/var/www/apt.fluentbit.io/amazonlinux/2022/x86_64" \;
"$CREATE_REPO_CMD" "/var/www/apt.fluentbit.io/amazonlinux/2022/x86_64"
"$CREATE_REPO_CMD" "$CREATE_REPO_ARGS" "/var/www/apt.fluentbit.io/amazonlinux/2022/x86_64"

find "$SOURCE_DIR/amazonlinux/2022" -iname "*-bit-$VERSION-*aarch64*.rpm" -exec cp -fv {} "/var/www/apt.fluentbit.io/amazonlinux/2022/aarch64" \;
"$CREATE_REPO_CMD" "/var/www/apt.fluentbit.io/amazonlinux/2022/aarch64"
"$CREATE_REPO_CMD" "$CREATE_REPO_ARGS" "/var/www/apt.fluentbit.io/amazonlinux/2022/aarch64"
fi

# Amazon Linux 2
echo "Publishing AmazonLinux 2"
find "$SOURCE_DIR/amazonlinux/2" -iname "*-bit-$VERSION-*aarch64*.rpm" -exec cp -fv {} "/var/www/apt.fluentbit.io/amazonlinux/2/aarch64" \;
"$CREATE_REPO_CMD" "/var/www/apt.fluentbit.io/amazonlinux/2/aarch64"
"$CREATE_REPO_CMD" "$CREATE_REPO_ARGS" "/var/www/apt.fluentbit.io/amazonlinux/2/aarch64"

find "$SOURCE_DIR/amazonlinux/2" -iname "*-bit-$VERSION-*x86_64*.rpm" -exec cp -fv {} "/var/www/apt.fluentbit.io/amazonlinux/2/x86_64" \;
"$CREATE_REPO_CMD" "/var/www/apt.fluentbit.io/amazonlinux/2/x86_64"
"$CREATE_REPO_CMD" "$CREATE_REPO_ARGS" "/var/www/apt.fluentbit.io/amazonlinux/2/x86_64"

# Centos 7
echo "Publishing Centos 7"
find "$SOURCE_DIR/centos/7/" -iname "*-bit-$VERSION-*aarch64*.rpm" -exec cp -fv {} "/var/www/apt.fluentbit.io/centos/7/aarch64" \;
"$CREATE_REPO_CMD" "/var/www/apt.fluentbit.io/centos/7/aarch64"
"$CREATE_REPO_CMD" "$CREATE_REPO_ARGS" "/var/www/apt.fluentbit.io/centos/7/aarch64"

find "$SOURCE_DIR/centos/7/" -iname "*-bit-$VERSION-*x86_64*.rpm" -exec cp -fv {} "/var/www/apt.fluentbit.io/centos/7/x86_64" \;
"$CREATE_REPO_CMD" "/var/www/apt.fluentbit.io/centos/7/x86_64"
"$CREATE_REPO_CMD" "$CREATE_REPO_ARGS" "/var/www/apt.fluentbit.io/centos/7/x86_64"

# Centos 8
echo "Publishing Centos 8"
find "$SOURCE_DIR/centos/8/" -iname "*-bit-$VERSION-*aarch64*.rpm" -exec cp -fv {} "/var/www/apt.fluentbit.io/centos/8/aarch64" \;
"$CREATE_REPO_CMD" "/var/www/apt.fluentbit.io/centos/8/aarch64"
"$CREATE_REPO_CMD" "$CREATE_REPO_ARGS" "/var/www/apt.fluentbit.io/centos/8/aarch64"

find "$SOURCE_DIR/centos/8/" -iname "*-bit-$VERSION-*x86_64*.rpm" -exec cp -fv {} "/var/www/apt.fluentbit.io/centos/8/x86_64" \;
"$CREATE_REPO_CMD" "/var/www/apt.fluentbit.io/centos/8/x86_64"
"$CREATE_REPO_CMD" "$CREATE_REPO_ARGS" "/var/www/apt.fluentbit.io/centos/8/x86_64"

# Centos 9
if [[ -d "$SOURCE_DIR/centos/9/" ]]; then
echo "Publishing Centos 9"
find "$SOURCE_DIR/centos/9/" -iname "*-bit-$VERSION-*aarch64*.rpm" -exec cp -fv {} "/var/www/apt.fluentbit.io/centos/9/aarch64" \;
"$CREATE_REPO_CMD" "/var/www/apt.fluentbit.io/centos/9/aarch64"
"$CREATE_REPO_CMD" "$CREATE_REPO_ARGS" "/var/www/apt.fluentbit.io/centos/9/aarch64"

find "$SOURCE_DIR/centos/9/" -iname "*-bit-$VERSION-*x86_64*.rpm" -exec cp -fv {} "/var/www/apt.fluentbit.io/centos/9/x86_64" \;
"$CREATE_REPO_CMD" "/var/www/apt.fluentbit.io/centos/9/x86_64"
"$CREATE_REPO_CMD" "$CREATE_REPO_ARGS" "/var/www/apt.fluentbit.io/centos/9/x86_64"
fi

# Debian 10 Buster
Expand Down
7 changes: 4 additions & 3 deletions packaging/update-repos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ fi

# Handle Ubuntu 18/22 differences - no support on Ubuntu 20
CREATE_REPO_CMD=${CREATE_REPO_CMD:-}
CREATE_REPO_ARGS=${CREATE_REPO_ARGS:--dvp}

# Assume if set we want to use it
if [[ -n "$CREATE_REPO_CMD" ]]; then
echo "Using $CREATE_REPO_CMD"
elif command -v createrepo &> /dev/null; then
echo "Found createrepo"
CREATE_REPO_CMD="createrepo -dvp"
CREATE_REPO_CMD="createrepo"
elif command -v createrepo_c &> /dev/null; then
echo "Found createrepo_c"
CREATE_REPO_CMD="createrepo_c -dvp"
CREATE_REPO_CMD="createrepo_c"
else
echo "Unable to find a command equivalent to createrepo"
exit 1
Expand All @@ -44,7 +45,7 @@ for RPM_REPO in "${RPM_REPO_PATHS[@]}"; do
find "$REPO_DIR" -name "*-bit-*.rpm" -exec rpm --define "_gpg_name $GPG_KEY" --addsign {} \;
fi
# Create full metadata for all RPMs in the directory
"$CREATE_REPO_CMD" "$REPO_DIR"
"$CREATE_REPO_CMD" "$CREATE_REPO_ARGS" "$REPO_DIR"

# Set up repo info
if [[ -n "${AWS_S3_BUCKET:-}" ]]; then
Expand Down

0 comments on commit 7988ec6

Please sign in to comment.