From cd92cf36099e69c09b0448e6bc0032bd4ac81ac5 Mon Sep 17 00:00:00 2001 From: Pat Date: Tue, 15 Mar 2022 12:22:11 +0000 Subject: [PATCH] packaging: add updates for server publishing (#5080) Signed-off-by: Patrick Stephens --- packaging/server/README.md | 1 + packaging/server/aptly.conf | 76 +++++++++++++++++++++++++++++++++ packaging/server/publish-all.sh | 44 +++++++++++++++---- 3 files changed, 113 insertions(+), 8 deletions(-) create mode 100644 packaging/server/README.md create mode 100644 packaging/server/aptly.conf diff --git a/packaging/server/README.md b/packaging/server/README.md new file mode 100644 index 00000000000..a2d05302f57 --- /dev/null +++ b/packaging/server/README.md @@ -0,0 +1 @@ +This directory contains the necessary files to support publishing release packages. \ No newline at end of file diff --git a/packaging/server/aptly.conf b/packaging/server/aptly.conf new file mode 100644 index 00000000000..3589ce86db5 --- /dev/null +++ b/packaging/server/aptly.conf @@ -0,0 +1,76 @@ +{ + "rootDir": "/var/www/apt.fluentbit.io", + "downloadConcurrency": 4, + "downloadSpeedLimit": 0, + "architectures": ["i386", "amd64", "arm64", "armhf"], + "dependencyFollowSuggests": false, + "dependencyFollowRecommends": false, + "dependencyFollowAllVariants": false, + "dependencyFollowSource": false, + "dependencyVerboseResolve": false, + "gpgDisableSign": false, + "gpgDisableVerify": false, + "gpgProvider": "gpg2", + "downloadSourcePackages": false, + "skipLegacyPool": true, + "ppaDistributorID": "ubuntu", + "ppaCodename": "", + "skipContentsPublishing": false, + "FileSystemPublishEndpoints": { + "debian/jessie": { + "rootDir": "/var/www/apt.fluentbit.io/debian/jessie", + "linkMethod": "copy", + "verifyMethod": "md5" + }, + "debian/stretch": { + "rootDir": "/var/www/apt.fluentbit.io/debian/stretch", + "linkMethod": "copy", + "verifyMethod": "md5" + }, + "debian/buster": { + "rootDir": "/var/www/apt.fluentbit.io/debian/buster", + "linkMethod": "copy", + "verifyMethod": "md5" + }, + "debian/bullseye": { + "rootDir": "/var/www/apt.fluentbit.io/debian/bullseye", + "linkMethod": "copy", + "verifyMethod": "md5" + }, + "ubuntu/xenial": { + "rootDir": "/var/www/apt.fluentbit.io/ubuntu/xenial", + "linkMethod": "copy", + "verifyMethod": "md5" + }, + "ubuntu/bionic": { + "rootDir": "/var/www/apt.fluentbit.io/ubuntu/bionic", + "linkMethod": "copy", + "verifyMethod": "md5" + }, + "ubuntu/focal": { + "rootDir": "/var/www/apt.fluentbit.io/ubuntu/focal", + "linkMethod": "copy", + "verifyMethod": "md5" + }, + "raspbian/jessie": { + "rootDir": "/var/www/apt.fluentbit.io/raspbian/jessie", + "linkMethod": "copy", + "verifyMethod": "md5" + }, + "raspbian/stretch": { + "rootDir": "/var/www/apt.fluentbit.io/raspbian/stretch", + "linkMethod": "copy", + "verifyMethod": "md5" + }, + "raspbian/buster": { + "rootDir": "/var/www/apt.fluentbit.io/raspbian/buster", + "linkMethod": "copy", + "verifyMethod": "md5" + }, + "raspbian/bullseye": { + "rootDir": "/var/www/apt.fluentbit.io/raspbian/bullseye", + "linkMethod": "copy", + "verifyMethod": "md5" + } + } +} diff --git a/packaging/server/publish-all.sh b/packaging/server/publish-all.sh index bccba01c7f4..5af97e3b3ff 100644 --- a/packaging/server/publish-all.sh +++ b/packaging/server/publish-all.sh @@ -2,7 +2,7 @@ set -eux SOURCE_DIR=${SOURCE_DIR:-$HOME/apt} -APTLY_CONFIG=${APTLY_CONFIG:-$HOME/.aptly.conf} +APTLY_CONFIG=${APTLY_CONFIG:-/etc/aptly.conf} if [ -z "$1" ]; then echo "Usage: ./publish_all new_version" @@ -47,40 +47,68 @@ 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}" +if ! aptly -config="$APTLY_CONFIG" publish switch buster filesystem:debian/buster: "fluent-bit-debian-buster-${VERSION}" ; then + # Cleanup snapshot in case we want to retry later + aptly -config="$APTLY_CONFIG" snapshot drop "fluent-bit-debian-buster-${VERSION}" + exit 1 +fi # 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}" +if ! aptly -config="$APTLY_CONFIG" publish switch bullseye filesystem:debian/bullseye: "fluent-bit-debian-bullseye-${VERSION}"; then + # Cleanup snapshot in case we want to retry later + aptly -config="$APTLY_CONFIG" snapshot drop "fluent-bit-debian-bullseye-${VERSION}" + exit 1 +fi # 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}" +if ! aptly -config="$APTLY_CONFIG" publish switch buster filesystem:raspbian/buster: "fluent-bit-raspbian-buster-${VERSION}" ; then + # Cleanup snapshot in case we want to retry later + aptly -config="$APTLY_CONFIG" snapshot drop "fluent-bit-raspbian-buster-${VERSION}" + exit 1 +fi # 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}" +if ! aptly -config="$APTLY_CONFIG" publish switch bullseye filesystem:raspbian/bullseye: "fluent-bit-raspbian-bullseye-${VERSION}" ; then + # Cleanup snapshot in case we want to retry later + aptly -config="$APTLY_CONFIG" snapshot drop "fluent-bit-raspbian-bullseye-${VERSION}" + exit 1 +fi # 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}" +if ! aptly -config="$APTLY_CONFIG" publish switch xenial filesystem:ubuntu/xenial: "fluent-bit-ubuntu-xenial-${VERSION}" ; then + # Cleanup snapshot in case we want to retry later + aptly -config="$APTLY_CONFIG" snapshot drop "fluent-bit-ubuntu-xenial-${VERSION}" + exit 1 +fi # 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}" +if ! aptly -config="$APTLY_CONFIG" publish switch bionic filesystem:ubuntu/bionic: "fluent-bit-ubuntu-bionic-${VERSION}" ; then + # Cleanup snapshot in case we want to retry later + aptly -config="$APTLY_CONFIG" snapshot drop "fluent-bit-ubuntu-bionic-${VERSION}" + exit 1 +fi # 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}" +if ! aptly -config="$APTLY_CONFIG" publish switch focal filesystem:ubuntu/focal: "fluent-bit-ubuntu-focal-${VERSION}"; then + # Cleanup snapshot in case we want to retry later + aptly -config="$APTLY_CONFIG" snapshot drop "fluent-bit-ubuntu-focal-${VERSION}" + exit 1 +fi