Skip to content

Commit

Permalink
Merge pull request #22 from andypitcher/fix-centos9-sign
Browse files Browse the repository at this point in the history
Update gpg import with --batch and change expect prompt
  • Loading branch information
andypitcher authored Oct 24, 2023
2 parents 3902946 + c8c1fd6 commit cac00f2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions policy/centos9/scripts/sign
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ case "$RPM_CHANNEL" in
echo "TESTING_PRIVATE_KEY not defined, failing rpm sign"
exit 1
fi
gpg --import - <<<"$TESTING_PRIVATE_KEY"
gpg --batch --import - <<< "$TESTING_PRIVATE_KEY"
;;
"production")
if ! grep "BEGIN PGP PRIVATE KEY BLOCK" <<<"$PRIVATE_KEY"; then
echo "PRIVATE_KEY not defined, failing rpm sign"
exit 1
fi
gpg --import - <<<"$PRIVATE_KEY"
gpg --batch --import - <<< "$PRIVATE_KEY"
;;
*)
echo "RPM_CHANNEL $RPM_CHANNEL does not match one of: [testing, production]"
Expand All @@ -37,7 +37,7 @@ esac
expect <<EOF
set timeout 60
spawn sh -c "rpmsign --addsign dist/centos9/**/rancher-*.rpm"
expect "Enter pass phrase:"
expect "Passphrase:"
send -- "$PRIVATE_KEY_PASS_PHRASE\r"
expect eof
lassign [wait] _ _ _ code
Expand Down

0 comments on commit cac00f2

Please sign in to comment.