@@ -10,20 +10,24 @@ OBJECT_STORAGE_ENDPOINT="https://object.storage.eu01.onstackit.cloud"
1010APT_BUCKET_NAME=" stackit-cli-apt"
1111PUBLIC_KEY_BUCKET_NAME=" stackit-public-key"
1212PUBLIC_KEY_FILE=" key.gpg"
13- CUSTOM_KEYRING= " custom -keyring"
13+ CUSTOM_KEYRING_FILE= " aptly -keyring.gpg "
1414DISTRIBUTION=" stackit"
1515APTLY_CONFIG_FILE_PATH=" ./.aptly.conf"
1616GORELEASER_PACKAGES_FOLDER=" dist/"
1717
18+ # We need to disable the key database daemon (keyboxd)
19+ # This can be done by removing "use-keyboxd" from ~/.gnupg/common.conf (see https://github.com/gpg/gnupg/blob/master/README)
20+ echo -n > ~/.gnupg/common.conf
21+
1822# Create a local mirror of the current state of the remote APT repository
1923printf " >>> Creating mirror \n"
2024curl ${OBJECT_STORAGE_ENDPOINT} /${PUBLIC_KEY_BUCKET_NAME} /${PUBLIC_KEY_FILE} > public.asc
21- gpg -- no-default-keyring --keyring ./ ${CUSTOM_KEYRING} .gpg --import public.asc
22- aptly mirror create -keyring=" ${CUSTOM_KEYRING} .gpg " current " ${OBJECT_STORAGE_ENDPOINT} /${APT_BUCKET_NAME} " ${DISTRIBUTION}
25+ gpg -v -- no-default-keyring --keyring= ${CUSTOM_KEYRING_FILE} --import public.asc
26+ aptly mirror create -config " ${APTLY_CONFIG_FILE_PATH} " - keyring=" ${CUSTOM_KEYRING_FILE} " current " ${OBJECT_STORAGE_ENDPOINT} /${APT_BUCKET_NAME} " ${DISTRIBUTION}
2327
2428# Update the mirror to the latest state
2529printf " \n>>> Updating mirror \n"
26- aptly mirror update current
30+ aptly mirror update -keyring= " ${CUSTOM_KEYRING_FILE} " current
2731
2832# Create a snapshot of the mirror
2933printf " \n>>> Creating snapshop from mirror \n"
@@ -47,4 +51,4 @@ aptly snapshot pull -no-remove -architectures="amd64,i386,arm64" current-snapsho
4751
4852# Publish the new snapshot to the remote repo
4953printf " \n>>> Publishing updated snapshot \n"
50- aptly publish switch - gpg-key=" ${GPG_PRIVATE_KEY_ID} " -passphrase " ${GPG_PASSPHRASE} " -config " ${APTLY_CONFIG_FILE_PATH} " ${DISTRIBUTION} " s3:${APT_BUCKET_NAME} :" updated-snapshot
54+ aptly publish snapshot -keyring= " ${CUSTOM_KEYRING_FILE} " - gpg-key=" ${GPG_PRIVATE_KEY_ID} " -passphrase " ${GPG_PASSPHRASE} " -config " ${APTLY_CONFIG_FILE_PATH} " updated-snapshot " s3:${APT_BUCKET_NAME} :"
0 commit comments