From e6ac42e158ed5ceee2c58eaf2f23a0ad3bb82f41 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 19 Oct 2026 20:53:05 +0200 Subject: Track the slackrepo config; add sb-publish and publish gates slackrepo_SBo-danix.conf is now kept here. Site values (rsync target, Gotify URL and key) moved to the root-only SBo-danix.local it sources; make-local.py migrates them out of an old inline config. The rsync push moved into sb-publish; rsync_push_hook calls it and holds back when SBB_PUBLISH=n, so sb-builder can build without publishing and publish later. --preview does not set OPT_DRY_RUN, so the hooks now also check OPT_PREVIEW: previews no longer notify Gotify or run manage-packages.sh for real. gpg-agent.conf adds allow-preset-passphrase so sb-builder can unlock the signing key for jobs without a tty. Co-Authored-By: Claude Opus 5.5 --- sb-publish | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 sb-publish (limited to 'sb-publish') diff --git a/sb-publish b/sb-publish new file mode 100755 index 0000000..9f53c5f --- /dev/null +++ b/sb-publish @@ -0,0 +1,35 @@ +#!/bin/bash +# Copyright (C) 2026 Danilo M. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. See the LICENSE file for details. + +# sb-publish: push the local package repository to the public mirror. +# +# Usage: sb-publish [PKGREPO] (default /repo) +# +# Called by rsync_push_hook in slackrepo_SBo-danix.conf after a build, unless +# the build ran with SBB_PUBLISH=n; run it by hand (or from sb-builder's +# Publish action) to push such builds later. Settings come from the root-only +# SB_LOCAL file (default /etc/slackrepo/SBo-danix.local): +# SB_RSYNC_TARGET rsync destination (required) +# SB_RSYNC_PASSWORD_FILE --password-file, if the file exists +# SB_RSYNC_EXCLUDES --exclude-from, if the file exists + +set -euo pipefail + +SB_LOCAL=${SB_LOCAL:-/etc/slackrepo/SBo-danix.local} +[ -r "$SB_LOCAL" ] && . "$SB_LOCAL" +: "${SB_RSYNC_TARGET:?SB_RSYNC_TARGET is not set in $SB_LOCAL}" + +pkgrepo=${1:-/repo} +args=( -havz --delete-after --stats ) +[ -n "${SB_RSYNC_EXCLUDES:-}" ] && [ -f "$SB_RSYNC_EXCLUDES" ] && \ + args+=( --exclude-from="$SB_RSYNC_EXCLUDES" ) +[ -n "${SB_RSYNC_PASSWORD_FILE:-}" ] && [ -f "$SB_RSYNC_PASSWORD_FILE" ] && \ + args+=( --password-file="$SB_RSYNC_PASSWORD_FILE" ) + +echo "sb-publish: pushing $pkgrepo to $SB_RSYNC_TARGET ..." +rsync "${args[@]}" "$pkgrepo"/ "$SB_RSYNC_TARGET" +echo "sb-publish: rsync push complete." -- cgit v1.2.3