2018-03-20 14:00:30 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-05-04 09:24:18 +02:00
|
|
|
passphrase="$(pwgen -1 -n 20)"
|
|
|
|
|
2018-03-21 10:09:04 +01:00
|
|
|
cat >keyparms <<EOF
|
|
|
|
%echo Generating a basic OpenPGP key
|
|
|
|
Key-Type: DSA
|
|
|
|
Key-Length: 1024
|
|
|
|
Subkey-Type: ELG-E
|
|
|
|
Subkey-Length: 1024
|
2018-05-04 09:24:18 +02:00
|
|
|
Name-Real: $(git config user.name)
|
2018-03-21 10:09:04 +01:00
|
|
|
Name-Comment: dev deb repo
|
2018-05-04 09:24:18 +02:00
|
|
|
Name-Email: $(git config user.email)
|
2018-03-21 10:09:04 +01:00
|
|
|
Expire-Date: 0
|
2018-05-04 09:24:18 +02:00
|
|
|
Passphrase: ${passphrase}
|
2018-03-21 10:09:04 +01:00
|
|
|
%commit
|
|
|
|
%echo done
|
|
|
|
EOF
|
|
|
|
export PINENTRY_USER_DATA="USE_CURSES=1"
|
|
|
|
gpg --gen-key --batch keyparms
|
|
|
|
gpg --export --armor > /signing-key/dev.pubkey
|
|
|
|
|
2018-03-20 14:00:30 +01:00
|
|
|
aptly repo create --component="main" --distribution="ubuntu" dev
|
|
|
|
aptly repo add dev /packages
|
2018-05-04 09:24:18 +02:00
|
|
|
aptly publish repo --batch --passphrase="${passphrase}" dev
|
2018-03-20 14:00:30 +01:00
|
|
|
aptly serve
|