diff --git a/k8s/apps/pkg-repo/deployment.yaml b/k8s/apps/pkg-repo/deployment.yaml index b1848df..d5d89c1 100644 --- a/k8s/apps/pkg-repo/deployment.yaml +++ b/k8s/apps/pkg-repo/deployment.yaml @@ -31,7 +31,7 @@ data: # Install reprepro (one-time, cached in PVC) if ! command -v reprepro &>/dev/null; then - apt-get update && apt-get install -y --no-install-recommends reprepro gpg + apt-get update && apt-get install -y --no-install-recommends reprepro gpg gpg-agent rm -rf /var/lib/apt/lists/* fi @@ -41,20 +41,14 @@ data: # Export public key for clients gpg --armor --export > /repo/pubkey.gpg - # Init reprepro if not done - if [ ! -f /repo/debian/db/version ]; then - echo "Initializing reprepro..." - mkdir -p /repo/debian/conf - cp /config/distributions /repo/debian/conf/ - cp /config/options /repo/debian/conf/ - cd /repo/debian && reprepro export - fi - - # Always ensure conf is up-to-date + # Always ensure conf is up-to-date and repo is initialized mkdir -p /repo/debian/conf cp /config/distributions /repo/debian/conf/ cp /config/options /repo/debian/conf/ + # Export (initialize or re-sign) the repo + cd /repo/debian && reprepro export + # Index page cat > /repo/index.html <<'HTML'