Skip to content

Commit

Permalink
Fix custom keyring path when mirroring repo
Browse files Browse the repository at this point in the history
  • Loading branch information
joaopalet committed Mar 6, 2024
1 parent 69c8596 commit 2cd4d56
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
1 change: 0 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.CLI_RELEASE }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
- name: Publish packages to APT repo
if: contains(github.ref_name, '-') == false
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
GPG_PRIVATE_KEY_ID: ${{ steps.import_gpg.outputs.keyid }}
Expand Down
14 changes: 14 additions & 0 deletions public.asc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----

mDMEZecIDBYJKwYBBAHaRw8BAQdAkJdEvuTh7E95zz3bwKLNSn7CiYrKSK0rjy8Y
DBTIqYq0NVNUQUNLSVQgR1BHIFNJR05FUiA8c3RhY2tpdC1ncGctc2lnbmVyQHN0
YWNraXQuY2xvdWQ+iJkEExYKAEEWIQSdnh7Gtp/l8z02ElhB2Hp1SygX/gUCZecI
DAIbAwUJAO1OAAULCQgHAgIiAgYVCgkICwIEFgIDAQIeBwIXgAAKCRBB2Hp1SygX
/vKZAP9s/T0F4A/4urNq6SoJGK2cbFUr/N5ReuIns3uDugFF2QEA8RtIeZmDcrZe
gIYLYXxdmnWE9a0c40VO/VMJWer0kwu4OARl5wgMEgorBgEEAZdVAQUBAQdAsMmj
G7eHWlL1M0cBYDKD4wY0ho+moixXDJj71hVEHXEDAQgHiH4EGBYKACYWIQSdnh7G
tp/l8z02ElhB2Hp1SygX/gUCZecIDAIbDAUJAO1OAAAKCRBB2Hp1SygX/ksfAP9F
D5HVH5qcAYI5+7gwhQWjwKQCTIDGE4z7frTnt6NB/QEAheahd+Rv/N9KSJsjyesU
CBXspQZQZZkRaS79frnnkAQ=
=1WMx
-----END PGP PUBLIC KEY BLOCK-----
11 changes: 7 additions & 4 deletions scripts/publish-apt-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,22 @@ OBJECT_STORAGE_ENDPOINT="https://object.storage.eu01.onstackit.cloud"
APT_BUCKET_NAME="stackit-cli-apt"
PUBLIC_KEY_BUCKET_NAME="stackit-public-key"
PUBLIC_KEY_FILE="key.gpg"
CUSTOM_KEYRING="custom-keyring"
CUSTOM_KEYRING_PIPELINE_FOLDER="/Users/runner/.gnupg"
CUSTOM_KEYRING_FILE="custom-keyring.gpg"
DISTRIBUTION="stackit"
APTLY_CONFIG_FILE_PATH="./.aptly.conf"
GORELEASER_PACKAGES_FOLDER="dist/"

# Create a local mirror of the current state of the remote APT repository
printf ">>> Creating mirror \n"
curl ${OBJECT_STORAGE_ENDPOINT}/${PUBLIC_KEY_BUCKET_NAME}/${PUBLIC_KEY_FILE} >public.asc
gpg --no-default-keyring --keyring ./${CUSTOM_KEYRING}.gpg --import public.asc
aptly mirror create -keyring="${CUSTOM_KEYRING}.gpg" current "${OBJECT_STORAGE_ENDPOINT}/${APT_BUCKET_NAME}" ${DISTRIBUTION}
# curl ${OBJECT_STORAGE_ENDPOINT}/${PUBLIC_KEY_BUCKET_NAME}/${PUBLIC_KEY_FILE} >public.asc
# gpg --no-default-keyring --keyring=${CUSTOM_KEYRING_PIPELINE_FOLDER}/${CUSTOM_KEYRING_FILE} --import public.asc
# aptly mirror create -keyring="${CUSTOM_KEYRING_FILE}" current "${OBJECT_STORAGE_ENDPOINT}/${APT_BUCKET_NAME}" ${DISTRIBUTION} # Folder (CUSTOM_KEYRING_PIPELINE_FOLDER) is appended automatic in the aptly command
aptly mirror create current "${OBJECT_STORAGE_ENDPOINT}/${APT_BUCKET_NAME}" ${DISTRIBUTION}

# Update the mirror to the latest state
printf "\n>>> Updating mirror \n"
# aptly mirror update -keyring="${CUSTOM_KEYRING_FILE}" current
aptly mirror update current

# Create a snapshot of the mirror
Expand Down

0 comments on commit 2cd4d56

Please sign in to comment.