CI: per-user digest file path (avoid /tmp collision between manual + runner)
This commit is contained in:
@@ -13,6 +13,8 @@ set -euo pipefail
|
||||
REGISTRY="${REGISTRY:-git.bztmon.com}"
|
||||
IMAGE="${IMAGE:-jwright/bztmon-site}"
|
||||
REF="${REGISTRY}/${IMAGE}"
|
||||
# Per-user digest file so manual (odysseus) and CI (gitea-runner) runs never collide in /tmp.
|
||||
DIGEST_FILE="${DIGEST_FILE:-${TMPDIR:-/tmp}/bztmon-site-$(id -un).digest}"
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
@@ -33,9 +35,9 @@ retry buildah build --retry 3 --retry-delay 5s --layers -t "${REF}:${TAG}" -t "$
|
||||
|
||||
if [[ "${1:-}" == "push" ]]; then
|
||||
echo ">> pushing ${REF}:${TAG}"
|
||||
retry buildah push --digestfile /tmp/bztmon-site.digest "${REF}:${TAG}"
|
||||
retry buildah push --digestfile "${DIGEST_FILE}" "${REF}:${TAG}"
|
||||
retry buildah push "${REF}:latest"
|
||||
DIGEST="$(cat /tmp/bztmon-site.digest)"
|
||||
DIGEST="$(cat "${DIGEST_FILE}")"
|
||||
echo
|
||||
echo ">> pin this in home-ops kubernetes/apps/bztmon-site/bztmon-site.yaml:"
|
||||
echo " image: ${REF}:${TAG}@${DIGEST}"
|
||||
|
||||
Reference in New Issue
Block a user