Skip to content

Commit

Permalink
packaging: add raspbian/bullseye and option to skip signing (#5099)
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Stephens <[email protected]>
  • Loading branch information
patrick-stephens authored Mar 17, 2022
1 parent 4653b3f commit f0ce4b3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/call-build-packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ jobs:
gpg --export -a "${{ steps.import_gpg.outputs.name }}" > ./latest/fluentbit.key
rpm --import ./latest/fluentbit.key
./update-repos.sh "${{ inputs.version }}" "./latest/"
./update-repos.sh "./latest/"
echo "${{ inputs.version }}" > "./latest/latest-version.txt"
aws s3 sync "./latest/" "s3://$AWS_S3_BUCKET" --delete --follow-symlinks --no-progress ${ENDPOINT}
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/staging-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
run: |
rm -f packaging/releases/*.repo
LATEST_VERSION=$(cat packaging/releases/latest-version.txt)
packaging/update-repos.sh "$VERSION" packaging/releases/
packaging/update-repos.sh packaging/releases/
rm -f packaging/releases/latest-version.txt
env:
GPG_KEY: ${{ steps.import_gpg.outputs.name }}
Expand Down
2 changes: 1 addition & 1 deletion packaging/remove-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ find "$BASE_PATH" -type f \( -iname "*-bit-${VERSION}*.rpm" -o -iname "*-bit-${V

# Update the repo metadata now
# VERSION is only used to find the RPM to sign so without it will skip signing
"$SCRIPT_DIR/update-repos.sh" "$VERSION" "$BASE_PATH"
"$SCRIPT_DIR/update-repos.sh" "$BASE_PATH"
27 changes: 15 additions & 12 deletions packaging/update-repos.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
#!/bin/bash
set -eux
# VERSION must be defined
VERSION=${VERSION:-$1}
# Where the base of all the repos is
BASE_PATH=${BASE_PATH:-$2}
BASE_PATH=${BASE_PATH:-$1}
# Set true to prevent signing
DISABLE_SIGNING=${DISABLE_SIGNING:-false}
if [[ "$DISABLE_SIGNING" != "true" ]]; then
echo "RPM signing configuration"
rpm -q gpg-pubkey --qf '%{name}-%{version}-%{release} --> %{summary}\n'
fi

RPM_REPO_PATHS=("amazonlinux/2" "centos/7" "centos/8")

echo "RPM signing configuration"
rpm -q gpg-pubkey --qf '%{name}-%{version}-%{release} --> %{summary}\n'

for RPM_REPO in "${RPM_REPO_PATHS[@]}"; do
echo "Updating $RPM_REPO"
REPO_DIR=$( realpath -sm "$BASE_PATH/$RPM_REPO" )
[[ ! -d "$REPO_DIR" ]] && continue

# Sign all RPMs created for this target, cover both fluent-bit and td-agent-bit packages
find "$REPO_DIR" -name "*-bit-*.rpm" -exec rpm --define "_gpg_name $GPG_KEY" --addsign {} \;

if [[ "$DISABLE_SIGNING" != "true" ]]; then
# Sign all RPMs created for this target, cover both fluent-bit and td-agent-bit packages
find "$REPO_DIR" -name "*-bit-*.rpm" -exec rpm --define "_gpg_name $GPG_KEY" --addsign {} \;
fi
# Create full metadata for all RPMs in the directory
createrepo -dvp "$REPO_DIR"

Expand All @@ -40,12 +42,12 @@ EOF
done

DEB_REPO_PATHS=( "debian/bullseye"
"debian/stretch"
"debian/buster"
"ubuntu/xenial"
"ubuntu/bionic"
"ubuntu/focal"
"raspbian/buster" )
"raspbian/buster"
"raspbian/bullseye" )

for DEB_REPO in "${DEB_REPO_PATHS[@]}"; do
REPO_DIR=$(realpath -sm "$BASE_PATH/$DEB_REPO" )
Expand All @@ -63,7 +65,8 @@ for DEB_REPO in "${DEB_REPO_PATHS[@]}"; do

cat << EOF > "$APTLY_CONFIG"
{
"rootDir": "$APTLY_ROOTDIR/"
"rootDir": "$APTLY_ROOTDIR/",
"gpgDisableSign": $DISABLE_SIGNING,
}
EOF
cat "$APTLY_CONFIG"
Expand Down

0 comments on commit f0ce4b3

Please sign in to comment.