From 18df4e881b1881861d2bf18bdeaf42f38dd3268c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Palet?= Date: Mon, 18 Mar 2024 18:00:05 +0000 Subject: [PATCH 1/2] Publish APT repo to new bucket --- .aptly.conf | 6 ++++++ scripts/publish-apt-packages.sh | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.aptly.conf b/.aptly.conf index d997ba8a5..975b5e185 100644 --- a/.aptly.conf +++ b/.aptly.conf @@ -26,6 +26,12 @@ "bucket": "stackit-cli-apt", "acl":"public-read", "endpoint": "object.storage.eu01.onstackit.cloud" + }, + "distribution": { + "region": "eu01", + "bucket": "distribution", + "acl":"public-read", + "endpoint": "object.storage.eu01.onstackit.cloud" } }, "SwiftPublishEndpoints": {}, diff --git a/scripts/publish-apt-packages.sh b/scripts/publish-apt-packages.sh index f2653a6a8..2160938e1 100755 --- a/scripts/publish-apt-packages.sh +++ b/scripts/publish-apt-packages.sh @@ -8,6 +8,7 @@ ROOT_DIR=$(git rev-parse --show-toplevel) OBJECT_STORAGE_ENDPOINT="https://object.storage.eu01.onstackit.cloud" APT_BUCKET_NAME="stackit-cli-apt" +APT_NEW_BUCKET_NAME="distribution" PUBLIC_KEY_BUCKET_NAME="stackit-public-key" PUBLIC_KEY_FILE="key.gpg" CUSTOM_KEYRING_FILE="aptly-keyring.gpg" @@ -51,4 +52,4 @@ aptly snapshot pull -no-remove -architectures="amd64,i386,arm64" current-snapsho # Publish the new snapshot to the remote repo printf "\n>>> Publishing updated snapshot \n" -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}:" +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_NEW_BUCKET_NAME}:apt/cli" From 214cfe3d05f48a4c5b7a8612206f65a5f5790844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Palet?= Date: Mon, 18 Mar 2024 18:12:41 +0000 Subject: [PATCH 2/2] Replace old bucket with new bucket --- .aptly.conf | 6 ------ scripts/publish-apt-packages.sh | 6 +++--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.aptly.conf b/.aptly.conf index 975b5e185..cbea3aee1 100644 --- a/.aptly.conf +++ b/.aptly.conf @@ -21,12 +21,6 @@ "skipBz2Publishing": false, "FileSystemPublishEndpoints": {}, "S3PublishEndpoints": { - "stackit-cli-apt": { - "region": "eu01", - "bucket": "stackit-cli-apt", - "acl":"public-read", - "endpoint": "object.storage.eu01.onstackit.cloud" - }, "distribution": { "region": "eu01", "bucket": "distribution", diff --git a/scripts/publish-apt-packages.sh b/scripts/publish-apt-packages.sh index 2160938e1..b112e56e5 100755 --- a/scripts/publish-apt-packages.sh +++ b/scripts/publish-apt-packages.sh @@ -7,8 +7,8 @@ set -eo pipefail ROOT_DIR=$(git rev-parse --show-toplevel) OBJECT_STORAGE_ENDPOINT="https://object.storage.eu01.onstackit.cloud" -APT_BUCKET_NAME="stackit-cli-apt" -APT_NEW_BUCKET_NAME="distribution" +APT_BUCKET_NAME="distribution" +APT_REPO_FOLDER="apt/cli" PUBLIC_KEY_BUCKET_NAME="stackit-public-key" PUBLIC_KEY_FILE="key.gpg" CUSTOM_KEYRING_FILE="aptly-keyring.gpg" @@ -52,4 +52,4 @@ aptly snapshot pull -no-remove -architectures="amd64,i386,arm64" current-snapsho # Publish the new snapshot to the remote repo printf "\n>>> Publishing updated snapshot \n" -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_NEW_BUCKET_NAME}:apt/cli" +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}"