Skip to content

Commit

Permalink
Update gpg import with --batch and change expect prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
andypitcher committed Oct 24, 2023
1 parent 3902946 commit c8c1fd6
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 c8c1fd6

Please sign in to comment.