-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
packaging: add publish script (#5069)
Signed-off-by: Patrick Stephens <[email protected]>
- Loading branch information
1 parent
07f5ea4
commit 30a54ef
Showing
1 changed file
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
#!/bin/bash | ||
set -eux | ||
|
||
SOURCE_DIR=${SOURCE_DIR:-$HOME/apt} | ||
APTLY_CONFIG=${APTLY_CONFIG:-$HOME/.aptly.conf} | ||
|
||
if [ -z "$1" ]; then | ||
echo "Usage: ./publish_all new_version" | ||
echo " | " | ||
echo " ----- " | ||
echo " 1.9.1 " | ||
echo | ||
exit 1 | ||
fi | ||
VERSION="$1" | ||
|
||
if [[ ! -d "$SOURCE_DIR" ]]; then | ||
echo "Missing source directory: $SOURCE_DIR" | ||
fi | ||
|
||
# Amazon Linux 2 | ||
echo "Publishing AmazonLinux 2" | ||
find "$SOURCE_DIR/amazonlinux/" -iname "*-bit-$VERSION-*aarch64*.rpm" -exec cp -fv {} "/var/www/apt.fluentbit.io/amazonlinux/2/aarch64" \; | ||
createrepo -dvp "/var/www/apt.fluentbit.io/amazonlinux/2/aarch64" | ||
|
||
find "$SOURCE_DIR/amazonlinux/" -iname "*-bit-$VERSION-*x86_64*.rpm" -exec cp -fv {} "/var/www/apt.fluentbit.io/amazonlinux/2/x86_64" \; | ||
createrepo -dvp "/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" \; | ||
createrepo -dvp "/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" \; | ||
createrepo -dvp "/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" \; | ||
createrepo -dvp "/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" \; | ||
createrepo -dvp "/var/www/apt.fluentbit.io/centos/8/x86_64" | ||
|
||
# Debian 10 Buster | ||
echo "Publishing Debian 10 Buster" | ||
# Conflicts otherwise with existing | ||
find "$SOURCE_DIR/debian/buster/" -iname "*-bit_$VERSION*.deb" -exec aptly -config="$APTLY_CONFIG" repo add flb-debian-buster {} \; | ||
aptly -config="$APTLY_CONFIG" snapshot create "fluent-bit-debian-buster-${VERSION}" from repo flb-debian-buster | ||
aptly -config="$APTLY_CONFIG" publish switch buster filesystem:debian/buster: "fluent-bit-debian-buster-${VERSION}" | ||
|
||
# Debian 11 Bullseye | ||
echo "Publishing Debian 11 Bullseye" | ||
find "$SOURCE_DIR/debian/bullseye/" -iname "*-bit_$VERSION*.deb" -exec aptly -config="$APTLY_CONFIG" repo add flb-debian-bullseye {} \; | ||
aptly -config="$APTLY_CONFIG" snapshot create "fluent-bit-debian-bullseye-${VERSION}" from repo flb-debian-bullseye | ||
aptly -config="$APTLY_CONFIG" publish switch bullseye filesystem:debian/bullseye: "fluent-bit-debian-bullseye-${VERSION}" | ||
|
||
# Raspbian 10 Buster | ||
echo "Publishing Raspbian 10 Buster" | ||
find "$SOURCE_DIR/raspbian/buster/" -iname "*-bit_$VERSION*.deb" -exec aptly -config="$APTLY_CONFIG" repo add flb-raspbian-buster {} \; | ||
aptly -config="$APTLY_CONFIG" snapshot create "fluent-bit-raspbian-buster-${VERSION}" from repo flb-raspbian-buster | ||
aptly -config="$APTLY_CONFIG" publish switch buster filesystem:raspbian/buster: "fluent-bit-raspbian-buster-${VERSION}" | ||
|
||
# Raspbian 11 Bullseye | ||
echo "Publishing Raspbian 11 Bullseye" | ||
find "$SOURCE_DIR/raspbian/bullseye/" -iname "*-bit_$VERSION*.deb" -exec aptly -config="$APTLY_CONFIG" repo add flb-raspbian-bullseye {} \; | ||
aptly -config="$APTLY_CONFIG" snapshot create "fluent-bit-raspbian-bullseye-${VERSION}" from repo flb-raspbian-bullseye | ||
aptly -config="$APTLY_CONFIG" publish switch bullseye filesystem:raspbian/bullseye: "fluent-bit-raspbian-bullseye-${VERSION}" | ||
|
||
# Ubuntu 16.04 Xenial | ||
echo "Publishing Ubuntu 16.04 Xenial" | ||
find "$SOURCE_DIR/ubuntu/xenial/" -iname "*-bit_$VERSION*.deb" -exec aptly -config="$APTLY_CONFIG" repo add flb-ubuntu-xenial {} \; | ||
aptly -config="$APTLY_CONFIG" snapshot create "fluent-bit-ubuntu-xenial-${VERSION}" from repo flb-ubuntu-xenial | ||
aptly -config="$APTLY_CONFIG" publish switch xenial filesystem:ubuntu/xenial: "fluent-bit-ubuntu-xenial-${VERSION}" | ||
|
||
# Ubuntu 18.04 Bionic | ||
echo "Publishing Ubuntu 18.04 Bionic" | ||
find "$SOURCE_DIR/ubuntu/bionic/" -iname "*-bit_$VERSION*.deb" -exec aptly -config="$APTLY_CONFIG" repo add flb-ubuntu-bionic {} \; | ||
aptly -config="$APTLY_CONFIG" snapshot create "fluent-bit-ubuntu-bionic-${VERSION}" from repo flb-ubuntu-bionic | ||
aptly -config="$APTLY_CONFIG" publish switch bionic filesystem:ubuntu/bionic: "fluent-bit-ubuntu-bionic-${VERSION}" | ||
|
||
# Ubuntu 20.04 Focal | ||
echo "Publishing Ubuntu 20.04 Focal" | ||
find "$SOURCE_DIR/ubuntu/focal/" -iname "*-bit_$VERSION*.deb" -exec aptly -config="$APTLY_CONFIG" repo add flb-ubuntu-focal {} \; | ||
aptly -config="$APTLY_CONFIG" snapshot create "fluent-bit-ubuntu-focal-${VERSION}" from repo flb-ubuntu-focal | ||
aptly -config="$APTLY_CONFIG" publish switch focal filesystem:ubuntu/focal: "fluent-bit-ubuntu-focal-${VERSION}" |