@@ -10,27 +10,32 @@ 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
+ DISTRIBUTION=" stackit"
14
15
APTLY_CONFIG_FILE_PATH=" ./.aptly.conf"
15
16
GORELEASER_PACKAGES_FOLDER=" dist/"
16
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
+
17
22
# Create a local mirror of the current state of the remote APT repository
18
23
printf " >>> Creating mirror \n"
19
24
curl ${OBJECT_STORAGE_ENDPOINT} /${PUBLIC_KEY_BUCKET_NAME} /${PUBLIC_KEY_FILE} > public.asc
20
- gpg --no-default-keyring --keyring ./ ${CUSTOM_KEYRING} .gpg --import public.asc
21
- aptly mirror create -keyring=" ${CUSTOM_KEYRING} .gpg " current " ${OBJECT_STORAGE_ENDPOINT} /${APT_BUCKET_NAME} " stackit
25
+ gpg --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}
22
27
23
28
# Update the mirror to the latest state
24
29
printf " \n>>> Updating mirror \n"
25
- aptly mirror update current
30
+ aptly mirror update -keyring= " ${CUSTOM_KEYRING_FILE} " current
26
31
27
32
# Create a snapshot of the mirror
28
33
printf " \n>>> Creating snapshop from mirror \n"
29
34
aptly snapshot create current-snapshot from mirror current
30
35
31
36
# Create a new fresh local APT repo
32
37
printf " \n>>> Creating fresh local repo \n"
33
- aptly repo create -distribution=" stackit-cli " new-repo
38
+ aptly repo create -distribution=" ${DISTRIBUTION} " new-repo
34
39
35
40
# Add new generated .deb packages to the new local repo
36
41
printf " \n>>> Adding new packages to local repo \n"
@@ -42,8 +47,8 @@ aptly snapshot create new-snapshot from repo new-repo
42
47
43
48
# Merge new-snapshot into current-snapshot creating a new snapshot updated-snapshot
44
49
printf " \n>>> Merging snapshots \n"
45
- aptly snapshot pull -no-remove -architectures=" amd64,i386,arm64" current-snapshot new-snapshot updated-snapshot stackit
50
+ aptly snapshot pull -no-remove -architectures=" amd64,i386,arm64" current-snapshot new-snapshot updated-snapshot ${DISTRIBUTION}
46
51
47
52
# Publish the new snapshot to the remote repo
48
53
printf " \n>>> Publishing updated snapshot \n"
49
- aptly publish switch - gpg-key=" ${GPG_PRIVATE_KEY_ID } " -passphrase " ${GPG_PASSPHRASE} " -config " ${APTLY_CONFIG_FILE_PATH} " stackit " s3:${APT_BUCKET_NAME} :" updated-snapshot
54
+ aptly publish snapshot -keyring= " ${CUSTOM_KEYRING_FILE} " - gpg-key=" ${GPG_PRIVATE_KEY_FINGERPRINT } " -passphrase " ${GPG_PASSPHRASE} " -config " ${APTLY_CONFIG_FILE_PATH} " updated-snapshot " s3:${APT_BUCKET_NAME} :"
0 commit comments