AptlyOnDemand/aptly.sh

27 lines
681 B
Bash
Raw Normal View History

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