Enclume : editeur CLAPI, catalogue de 26 packs, empaquetage Docker
Construction et publication / verifier (push) Successful in 41s
Construction et publication / verifier (pull_request) Successful in 11s
Construction et publication / publier (pull_request) Skipped
Construction et publication / publier (push) Failing after 6m3s

This commit is contained in:
hcornet committed 2026-09-10 11:32:03 +02:00
1 parent aa71251de0
commit de7a691861
59 files changed
+4466 -205

No files matched your search

+42
View File
@@ -0,0 +1,42 @@
#!/bin/sh
# Clone ou met a jour le depot du catalogue, publie son contenu dans le volume
# partage, puis notifie l'application. Boucle jusqu'a l'arret du conteneur.
set -eu
if [ -z "${CATALOG_REPO}" ]; then
echo "catalog-sync : CATALOG_REPO non defini, rien a synchroniser." >&2
exit 0
fi
TRAVAIL=/tmp/depot
sync_une_fois() {
if [ -d "$TRAVAIL/.git" ]; then
git -C "$TRAVAIL" fetch --quiet --depth 1 origin "$CATALOG_BRANCH"
git -C "$TRAVAIL" reset --quiet --hard "origin/$CATALOG_BRANCH"
else
git clone --quiet --depth 1 --branch "$CATALOG_BRANCH" "$CATALOG_REPO" "$TRAVAIL"
fi
SOURCE="$TRAVAIL/$CATALOG_SUBDIR"
[ -d "$SOURCE" ] || { echo "catalog-sync : $CATALOG_SUBDIR absent du depot." >&2; return 1; }
# Publication atomique : on ecrit a cote, puis on bascule.
NEUF="${CATALOG_DEST}.neuf"
rm -rf "$NEUF"
mkdir -p "$NEUF"
cp -a "$SOURCE"/. "$NEUF"/
rm -rf "${CATALOG_DEST}.ancien"
[ -d "$CATALOG_DEST" ] && mv "$CATALOG_DEST" "${CATALOG_DEST}.ancien"
mv "$NEUF" "$CATALOG_DEST"
rm -rf "${CATALOG_DEST}.ancien"
REVISION=$(git -C "$TRAVAIL" rev-parse --short HEAD)
echo "catalog-sync : catalogue a jour ($REVISION)"
curl -fsS -X POST "$RELOAD_URL" >/dev/null 2>&1 || echo "catalog-sync : rechargement non confirme"
}
while true; do
sync_une_fois || echo "catalog-sync : echec de la synchronisation, nouvelle tentative dans ${SYNC_INTERVAL}s" >&2
sleep "$SYNC_INTERVAL"
done