Skip to content

Commit

Permalink
Publish the GPG pub key to S3
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Mirić committed Mar 29, 2021
1 parent e2dd1bd commit dfe95a8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packaging/bin/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ log() {

signkeypath="$PWD/sign-key.gpg"
s3bucket="${S3_BUCKET-dl.k6.io}"
pkgdir="$PWD/Packages"

if ! [ -r "$signkeypath" ]; then
log "ERROR: Signing key not found at '$signkeypath'"
Expand All @@ -15,7 +16,8 @@ fi

gpg2 --import --batch --passphrase="$PGP_SIGN_KEY_PASSPHRASE" "$signkeypath"
export PGPKEYID="$(gpg2 --list-secret-keys --with-colons | grep '^sec' | cut -d: -f5)"
# TODO: Publish the pub key to S3
mkdir -p "$pkgdir"
gpg2 --export --armor --output "${pkgdir}/key.gpg" "$PGPKEYID"

# Setup RPM signing
cat > "$HOME/.rpmmacros" <<EOF
Expand All @@ -28,12 +30,12 @@ EOF

for repo in deb rpm msi; do
log "Creating ${repo} repository ..."
"create-${repo}-repo.sh" "$PWD/dist" "$PWD/Packages/${repo}"
"create-${repo}-repo.sh" "$PWD/dist" "${pkgdir}/${repo}"
done

# Generate and sync the main index.html
(cd Packages && generate_index.py)
(cd "$pkgdir" && generate_index.py)
s3cmd put --add-header='Cache-Control:no-cache, max-age=0' \
Packages/index.html "s3://${s3bucket}/index.html"
"${pkgdir}/index.html" "s3://${s3bucket}/index.html"

exec "$@"

0 comments on commit dfe95a8

Please sign in to comment.