Ne plus fournir l’identité et le mot de passe de la clé en dur

This commit is contained in:
Benjamin Bohard 2018-05-04 09:24:18 +02:00
parent b5f39b1ca6
commit 06941ae7ed
2 changed files with 10 additions and 5 deletions

View File

@ -32,7 +32,10 @@ fi
container_id=$(docker run -d -v ${PACKAGES_FOLDER}:/packages -v ${GPG_FOLDER}:/signing-key -p $PORT:8080 cadoles/aptly:dev) container_id=$(docker run -d -v ${PACKAGES_FOLDER}:/packages -v ${GPG_FOLDER}:/signing-key -p $PORT:8080 cadoles/aptly:dev)
if [ $(docker ps -q --no-trunc | grep -q $container_id) ] docker ps -q --no-trunc | grep -q ${container_id}
res=$?
if [ "${res}" -eq 0 ]
then then
echo "container with id $container_id started" echo "container with id $container_id started"

View File

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