From e5b15426a1c718ce445c1694710277aacbb1a231 Mon Sep 17 00:00:00 2001 From: Matteo Date: Tue, 17 Mar 2026 15:35:40 +0100 Subject: [PATCH] feat : repertorie bug(WIP) --- RebuildBdd/bootstrap-target-host.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/RebuildBdd/bootstrap-target-host.sh b/RebuildBdd/bootstrap-target-host.sh index 4abae51..339a701 100755 --- a/RebuildBdd/bootstrap-target-host.sh +++ b/RebuildBdd/bootstrap-target-host.sh @@ -460,6 +460,18 @@ chmod 700 $(shell_quote "$TARGET_REPO_DIR/run-rebuild-bdd.sh") 2>/dev/null || tr chmod 700 $(shell_quote "$TARGET_REPO_DIR/rebuild-bdd-core.sh") 2>/dev/null || true chmod 700 $(shell_quote "$TARGET_REPO_DIR/Checkup/check-postgresql.sh") 2>/dev/null || true chmod 700 $(shell_quote "$TARGET_REPO_DIR/Checkup/check-target-readiness.sh") 2>/dev/null || true + +for required_file in \ + $(shell_quote "$TARGET_REPO_DIR/run-rebuild-bdd.sh") \ + $(shell_quote "$TARGET_REPO_DIR/rebuild-bdd-core.sh") \ + $(shell_quote "$TARGET_REPO_DIR/Checkup/check-postgresql.sh") \ + $(shell_quote "$TARGET_REPO_DIR/Checkup/check-target-readiness.sh"); do + if [[ ! -f \"\$required_file\" ]]; then + echo \"fichier requis absent après synchronisation du dépôt : \$required_file\" >&2 + echo \"vérifier TARGET_REPO_DIR=$(shell_quote "$TARGET_REPO_DIR"), TARGET_REPO_URL=$(shell_quote "$TARGET_REPO_URL"), TARGET_REPO_BRANCH=$(shell_quote "$TARGET_REPO_BRANCH")\" >&2 + exit 1 + fi +done " log "Clone / mise à jour du dépôt distant" @@ -488,6 +500,11 @@ set -euo pipefail CHECK_SCRIPT=$(shell_quote "${TARGET_REPO_DIR}/Checkup/check-postgresql.sh") ENV_FILE=$(shell_quote "$TARGET_ENV_FILE_PATH") +[[ -f \"\$CHECK_SCRIPT\" ]] || { + echo \"script PostgreSQL introuvable : \$CHECK_SCRIPT\" >&2 + echo \"vérifier TARGET_REPO_DIR=$(shell_quote "$TARGET_REPO_DIR")\" >&2 + exit 1 +} [[ -x \"\$CHECK_SCRIPT\" ]] || chmod 700 \"\$CHECK_SCRIPT\" \"\$CHECK_SCRIPT\" --env-file \"\$ENV_FILE\" --non-interactive @@ -509,4 +526,4 @@ log "Validation finale de sudo -n -u postgres" ssh "${SSH_OPTS[@]}" "$REMOTE" "$REMOTE_VALIDATE_SUDO_POSTGRES_CMD" \ || fail "sudo -n -u postgres invalide sur la cible" -success "bootstrap initial terminé pour ${TARGET_NAME}" \ No newline at end of file +success "bootstrap initial terminé pour ${TARGET_NAME}"