|
2 | 2 | set -eux |
3 | 3 |
|
4 | 4 | SOURCE_DIR=${SOURCE_DIR:-$HOME/apt} |
5 | | -APTLY_CONFIG=${APTLY_CONFIG:-$HOME/.aptly.conf} |
| 5 | +APTLY_CONFIG=${APTLY_CONFIG:-/etc/aptly.conf} |
6 | 6 |
|
7 | 7 | if [ -z "$1" ]; then |
8 | 8 | echo "Usage: ./publish_all new_version" |
@@ -47,40 +47,68 @@ echo "Publishing Debian 10 Buster" |
47 | 47 | # Conflicts otherwise with existing |
48 | 48 | find "$SOURCE_DIR/debian/buster/" -iname "*-bit_$VERSION*.deb" -exec aptly -config="$APTLY_CONFIG" repo add flb-debian-buster {} \; |
49 | 49 | aptly -config="$APTLY_CONFIG" snapshot create "fluent-bit-debian-buster-${VERSION}" from repo flb-debian-buster |
50 | | -aptly -config="$APTLY_CONFIG" publish switch buster filesystem:debian/buster: "fluent-bit-debian-buster-${VERSION}" |
| 50 | +if ! aptly -config="$APTLY_CONFIG" publish switch buster filesystem:debian/buster: "fluent-bit-debian-buster-${VERSION}" ; then |
| 51 | + # Cleanup snapshot in case we want to retry later |
| 52 | + aptly -config="$APTLY_CONFIG" snapshot drop "fluent-bit-debian-buster-${VERSION}" |
| 53 | + exit 1 |
| 54 | +fi |
51 | 55 |
|
52 | 56 | # Debian 11 Bullseye |
53 | 57 | echo "Publishing Debian 11 Bullseye" |
54 | 58 | find "$SOURCE_DIR/debian/bullseye/" -iname "*-bit_$VERSION*.deb" -exec aptly -config="$APTLY_CONFIG" repo add flb-debian-bullseye {} \; |
55 | 59 | aptly -config="$APTLY_CONFIG" snapshot create "fluent-bit-debian-bullseye-${VERSION}" from repo flb-debian-bullseye |
56 | | -aptly -config="$APTLY_CONFIG" publish switch bullseye filesystem:debian/bullseye: "fluent-bit-debian-bullseye-${VERSION}" |
| 60 | +if ! aptly -config="$APTLY_CONFIG" publish switch bullseye filesystem:debian/bullseye: "fluent-bit-debian-bullseye-${VERSION}"; then |
| 61 | + # Cleanup snapshot in case we want to retry later |
| 62 | + aptly -config="$APTLY_CONFIG" snapshot drop "fluent-bit-debian-bullseye-${VERSION}" |
| 63 | + exit 1 |
| 64 | +fi |
57 | 65 |
|
58 | 66 | # Raspbian 10 Buster |
59 | 67 | echo "Publishing Raspbian 10 Buster" |
60 | 68 | find "$SOURCE_DIR/raspbian/buster/" -iname "*-bit_$VERSION*.deb" -exec aptly -config="$APTLY_CONFIG" repo add flb-raspbian-buster {} \; |
61 | 69 | aptly -config="$APTLY_CONFIG" snapshot create "fluent-bit-raspbian-buster-${VERSION}" from repo flb-raspbian-buster |
62 | | -aptly -config="$APTLY_CONFIG" publish switch buster filesystem:raspbian/buster: "fluent-bit-raspbian-buster-${VERSION}" |
| 70 | +if ! aptly -config="$APTLY_CONFIG" publish switch buster filesystem:raspbian/buster: "fluent-bit-raspbian-buster-${VERSION}" ; then |
| 71 | + # Cleanup snapshot in case we want to retry later |
| 72 | + aptly -config="$APTLY_CONFIG" snapshot drop "fluent-bit-raspbian-buster-${VERSION}" |
| 73 | + exit 1 |
| 74 | +fi |
63 | 75 |
|
64 | 76 | # Raspbian 11 Bullseye |
65 | 77 | echo "Publishing Raspbian 11 Bullseye" |
66 | 78 | find "$SOURCE_DIR/raspbian/bullseye/" -iname "*-bit_$VERSION*.deb" -exec aptly -config="$APTLY_CONFIG" repo add flb-raspbian-bullseye {} \; |
67 | 79 | aptly -config="$APTLY_CONFIG" snapshot create "fluent-bit-raspbian-bullseye-${VERSION}" from repo flb-raspbian-bullseye |
68 | | -aptly -config="$APTLY_CONFIG" publish switch bullseye filesystem:raspbian/bullseye: "fluent-bit-raspbian-bullseye-${VERSION}" |
| 80 | +if ! aptly -config="$APTLY_CONFIG" publish switch bullseye filesystem:raspbian/bullseye: "fluent-bit-raspbian-bullseye-${VERSION}" ; then |
| 81 | + # Cleanup snapshot in case we want to retry later |
| 82 | + aptly -config="$APTLY_CONFIG" snapshot drop "fluent-bit-raspbian-bullseye-${VERSION}" |
| 83 | + exit 1 |
| 84 | +fi |
69 | 85 |
|
70 | 86 | # Ubuntu 16.04 Xenial |
71 | 87 | echo "Publishing Ubuntu 16.04 Xenial" |
72 | 88 | find "$SOURCE_DIR/ubuntu/xenial/" -iname "*-bit_$VERSION*.deb" -exec aptly -config="$APTLY_CONFIG" repo add flb-ubuntu-xenial {} \; |
73 | 89 | aptly -config="$APTLY_CONFIG" snapshot create "fluent-bit-ubuntu-xenial-${VERSION}" from repo flb-ubuntu-xenial |
74 | | -aptly -config="$APTLY_CONFIG" publish switch xenial filesystem:ubuntu/xenial: "fluent-bit-ubuntu-xenial-${VERSION}" |
| 90 | +if ! aptly -config="$APTLY_CONFIG" publish switch xenial filesystem:ubuntu/xenial: "fluent-bit-ubuntu-xenial-${VERSION}" ; then |
| 91 | + # Cleanup snapshot in case we want to retry later |
| 92 | + aptly -config="$APTLY_CONFIG" snapshot drop "fluent-bit-ubuntu-xenial-${VERSION}" |
| 93 | + exit 1 |
| 94 | +fi |
75 | 95 |
|
76 | 96 | # Ubuntu 18.04 Bionic |
77 | 97 | echo "Publishing Ubuntu 18.04 Bionic" |
78 | 98 | find "$SOURCE_DIR/ubuntu/bionic/" -iname "*-bit_$VERSION*.deb" -exec aptly -config="$APTLY_CONFIG" repo add flb-ubuntu-bionic {} \; |
79 | 99 | aptly -config="$APTLY_CONFIG" snapshot create "fluent-bit-ubuntu-bionic-${VERSION}" from repo flb-ubuntu-bionic |
80 | | -aptly -config="$APTLY_CONFIG" publish switch bionic filesystem:ubuntu/bionic: "fluent-bit-ubuntu-bionic-${VERSION}" |
| 100 | +if ! aptly -config="$APTLY_CONFIG" publish switch bionic filesystem:ubuntu/bionic: "fluent-bit-ubuntu-bionic-${VERSION}" ; then |
| 101 | + # Cleanup snapshot in case we want to retry later |
| 102 | + aptly -config="$APTLY_CONFIG" snapshot drop "fluent-bit-ubuntu-bionic-${VERSION}" |
| 103 | + exit 1 |
| 104 | +fi |
81 | 105 |
|
82 | 106 | # Ubuntu 20.04 Focal |
83 | 107 | echo "Publishing Ubuntu 20.04 Focal" |
84 | 108 | find "$SOURCE_DIR/ubuntu/focal/" -iname "*-bit_$VERSION*.deb" -exec aptly -config="$APTLY_CONFIG" repo add flb-ubuntu-focal {} \; |
85 | 109 | aptly -config="$APTLY_CONFIG" snapshot create "fluent-bit-ubuntu-focal-${VERSION}" from repo flb-ubuntu-focal |
86 | | -aptly -config="$APTLY_CONFIG" publish switch focal filesystem:ubuntu/focal: "fluent-bit-ubuntu-focal-${VERSION}" |
| 110 | +if ! aptly -config="$APTLY_CONFIG" publish switch focal filesystem:ubuntu/focal: "fluent-bit-ubuntu-focal-${VERSION}"; then |
| 111 | + # Cleanup snapshot in case we want to retry later |
| 112 | + aptly -config="$APTLY_CONFIG" snapshot drop "fluent-bit-ubuntu-focal-${VERSION}" |
| 113 | + exit 1 |
| 114 | +fi |
0 commit comments