@@ -6,11 +6,10 @@ set -eo pipefail
66
77ROOT_DIR=$( git rev-parse --show-toplevel)
88
9- OBJECT_STORAGE_ENDPOINT=" https://object.storage.eu01.onstackit.cloud"
9+ PACKAGES_BUCKET_URL=" https://packages.stackit.cloud"
10+ PUBLIC_KEY_FILE_PATH=" keys/key.gpg"
11+ APT_REPO_PATH=" apt/cli"
1012APT_BUCKET_NAME=" distribution"
11- APT_REPO_FOLDER=" apt/cli"
12- PUBLIC_KEY_BUCKET_NAME=" stackit-public-key"
13- PUBLIC_KEY_FILE=" key.gpg"
1413CUSTOM_KEYRING_FILE=" aptly-keyring.gpg"
1514DISTRIBUTION=" stackit"
1615APTLY_CONFIG_FILE_PATH=" ./.aptly.conf"
@@ -22,9 +21,9 @@ echo -n >~/.gnupg/common.conf
2221
2322# Create a local mirror of the current state of the remote APT repository
2423printf " >>> Creating mirror \n"
25- curl ${OBJECT_STORAGE_ENDPOINT } /${PUBLIC_KEY_BUCKET_NAME} / ${PUBLIC_KEY_FILE } > public.asc
24+ curl ${PACKAGES_BUCKET_URL } /${PUBLIC_KEY_FILE_PATH } > public.asc
2625gpg --no-default-keyring --keyring=${CUSTOM_KEYRING_FILE} --import public.asc
27- aptly mirror create -config " ${APTLY_CONFIG_FILE_PATH} " -keyring=" ${CUSTOM_KEYRING_FILE} " current " ${OBJECT_STORAGE_ENDPOINT } /${APT_BUCKET_NAME} / ${APT_REPO_FOLDER }" ${DISTRIBUTION}
26+ aptly mirror create -config " ${APTLY_CONFIG_FILE_PATH} " -keyring=" ${CUSTOM_KEYRING_FILE} " current " ${PACKAGES_BUCKET_URL } /${APT_REPO_PATH } " ${DISTRIBUTION}
2827
2928# Update the mirror to the latest state
3029printf " \n>>> Updating mirror \n"
@@ -52,4 +51,4 @@ aptly snapshot pull -no-remove -architectures="amd64,i386,arm64" current-snapsho
5251
5352# Publish the new snapshot to the remote repo
5453printf " \n>>> Publishing updated snapshot \n"
55- 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} :${APT_REPO_FOLDER } "
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} :${APT_REPO_PATH } "
0 commit comments