mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
38 lines
662 B
Plaintext
38 lines
662 B
Plaintext
|
#!/bin/bash
|
||
|
|
||
|
set -e -x
|
||
|
|
||
|
TMPDIR=$(mktemp -d)
|
||
|
cleanup() {
|
||
|
exit_code=$?
|
||
|
trap - EXIT INT
|
||
|
rm -rf ${TMPDIR}
|
||
|
exit ${exit_code}
|
||
|
}
|
||
|
trap cleanup EXIT INT
|
||
|
|
||
|
export HOME=${TMPDIR}
|
||
|
|
||
|
gpg --batch --gen-key - <<EOF
|
||
|
%echo Generating a default key
|
||
|
Key-Type: default
|
||
|
Subkey-Type: default
|
||
|
Name-Real: Rancher
|
||
|
Name-Comment: CI
|
||
|
Name-Email: ci@rancher.com
|
||
|
Expire-Date: 0
|
||
|
|
||
|
# Key-Length: 4096
|
||
|
# Subkey-Length: 4096
|
||
|
Passphrase: $PRIVATE_KEY_PASS_PHRASE
|
||
|
# %no-protection
|
||
|
# %no-ask-passphrase
|
||
|
|
||
|
# Do a commit here, so that we can later print "done" :-)
|
||
|
%commit
|
||
|
%echo done
|
||
|
EOF
|
||
|
|
||
|
gpg --armor --export ci@rancher.com >public.key
|
||
|
gpg --armor --export-secret-key ci@rancher.com >private.key
|