grafana/scripts/build/sign_packages.sh
Arve Knudsen 90b41e86f2
Fix package signing (#20451)
* Build: Fix package signing
2019-11-18 21:23:32 +01:00

26 lines
474 B
Bash
Executable File

#!/bin/bash
set -e
_files=$*
if [ -z "$_files" ]; then
echo "_files (arg 1) has to be set"
exit 1
fi
if [ -z "$GPG_KEY_PASSWORD" ]; then
echo "GPG_KEY_PASSWORD has to be set"
exit 1
fi
gpg --batch --allow-secret-key-import --import ~/private-repo/signing/private.key
cp ./scripts/build/rpmmacros ~/.rpmmacros
echo "$GPG_KEY_PASSWORD" > /tmp/gpg-passphrase
for package in $_files; do
[ -e "$package" ] || continue
rpm --addsign "$package"
done