Reprise du rechargement, version sans prefixe v
build / Garde-fou (pull_request) Successful in 11s
build / Images Harbor (catalog-sync, Dockerfile.catalog-sync) (pull_request) Skipped
build / Images Harbor (web, Dockerfile) (pull_request) Skipped
build / Images Harbor (catalog-sync, Dockerfile.catalog-sync) (push) Successful in 9m45s
build / Garde-fou (push) Successful in 10s
build / Images Harbor (web, Dockerfile) (push) Successful in 11m28s

This commit is contained in:
hcornet committed 2026-09-10 14:28:36 +02:00
1 parent 5f76b08ae6
commit c85aaaadf4
2 files changed
+21 -5

No files matched your search

+1 -1
View File
@@ -83,7 +83,7 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
ENCLUME_VERSION=${{ gitea.ref_name }}
ENCLUME_VERSION=${{ steps.meta.outputs.version }}
ENCLUME_COMMIT=${{ gitea.sha }}
BUILD_DATE=${{ steps.meta.outputs.created }}
# Les attestations de provenance de Buildx creent des manifestes
+20 -4
View File
@@ -20,6 +20,23 @@ if [ -z "${CATALOG_REPO:-}" ]; then
fi
TRAVAIL=/tmp/depot
TEMOIN=/tmp/derniere-revision-confirmee
# Previent l'application, et retient si elle a repondu. Tant que la reponse
# n'est pas obtenue, on retente au cycle suivant : au demarrage, catalog-sync
# publie souvent avant que web n'ecoute, et sans cette reprise le site
# resterait sur le catalogue charge a son lancement.
prevenir_application() {
revision="$1"
[ -n "${RELOAD_URL:-}" ] || return 0
[ "$(cat "$TEMOIN" 2>/dev/null)" = "$revision" ] && return 0
if curl -fsS --max-time 10 -X POST "$RELOAD_URL" >/dev/null 2>&1; then
echo "$revision" > "$TEMOIN"
echo "catalog-sync : application rechargee ($revision)"
else
echo "catalog-sync : application injoignable, nouvelle tentative au prochain cycle" >&2
fi
}
sync_une_fois() {
if [ -d "$TRAVAIL/.git" ]; then
@@ -40,7 +57,8 @@ sync_une_fois() {
CIBLE="$CATALOG_DEST/rev-$REVISION"
if [ -L "$CATALOG_DEST/actuel" ] && [ "$(readlink "$CATALOG_DEST/actuel")" = "$CIBLE" ]; then
return 0 # deja publie, rien a faire
prevenir_application "$REVISION" # publie, mais l'application l'ignore peut-etre encore
return 0
fi
rm -rf "$CIBLE.partiel" "$CIBLE"
@@ -57,9 +75,7 @@ sync_une_fois() {
done
echo "catalog-sync : catalogue publie ($REVISION)"
if [ -n "${RELOAD_URL:-}" ]; then
curl -fsS -X POST "$RELOAD_URL" >/dev/null 2>&1 || echo "catalog-sync : rechargement non confirme"
fi
prevenir_application "$REVISION"
}
while true; do