@@ -10,20 +10,24 @@ OBJECT_STORAGE_ENDPOINT="https://object.storage.eu01.onstackit.cloud"
10
10
APT_BUCKET_NAME=" stackit-cli-apt"
11
11
PUBLIC_KEY_BUCKET_NAME=" stackit-public-key"
12
12
PUBLIC_KEY_FILE=" key.gpg"
13
- CUSTOM_KEYRING= " custom -keyring"
13
+ CUSTOM_KEYRING_FILE= " aptly -keyring.gpg "
14
14
DISTRIBUTION=" stackit"
15
15
APTLY_CONFIG_FILE_PATH=" ./.aptly.conf"
16
16
GORELEASER_PACKAGES_FOLDER=" dist/"
17
17
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
+
18
22
# Create a local mirror of the current state of the remote APT repository
19
23
printf " >>> Creating mirror \n"
20
24
curl ${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}
23
27
24
28
# Update the mirror to the latest state
25
29
printf " \n>>> Updating mirror \n"
26
- aptly mirror update current
30
+ aptly mirror update -keyring= " ${CUSTOM_KEYRING_FILE} " current
27
31
28
32
# Create a snapshot of the mirror
29
33
printf " \n>>> Creating snapshop from mirror \n"
@@ -47,4 +51,4 @@ aptly snapshot pull -no-remove -architectures="amd64,i386,arm64" current-snapsho
47
51
48
52
# Publish the new snapshot to the remote repo
49
53
printf " \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