#!/bin/bash set -euo pipefail echo "🔍 VÉRIFICATION DU STATUT DES DÉPÔTS" echo "===================================" # Fonction de logging log() { echo "[$(date '+%Y-%m-%d %H:%M:%S')] $1" } # Liste des projets declare -a PROJECTS=( "lecoffre_node" "sdk_relay" "sdk_signer" "sdk_storage" "sdk_client" "sdk_common" "sdk-signer-client" "ihm_client" "lecoffre-front" "doc_api" "IA_agents" ) BASE_DIR="/home/debian/4NK_env" log "📊 Statut des projets dans $BASE_DIR:" echo "" for project in "${PROJECTS[@]}"; do project_path="$BASE_DIR/$project" echo "📩 $project:" if [ -d "$project_path" ]; then cd "$project_path" # VĂ©rifier si c'est un dĂ©pĂŽt Git if [ -d ".git" ]; then # Informations Git current_branch=$(git branch --show-current 2>/dev/null || echo "N/A") last_commit=$(git log -1 --oneline 2>/dev/null || echo "Aucun commit") git_status=$(git status --porcelain 2>/dev/null || echo "Erreur Git") echo " ✅ DĂ©pĂŽt Git dĂ©tectĂ©" echo " 📍 Branche: $current_branch" echo " 📝 Dernier commit: $last_commit" if [ "$git_status" = "Erreur Git" ]; then echo " ⚠ ProblĂšme Git dĂ©tectĂ©" elif [ -n "$git_status" ]; then echo " 🔄 Modifications non commitĂ©es" else echo " ✅ DĂ©pĂŽt propre" fi else echo " ⚠ Dossier sans dĂ©pĂŽt Git" fi # VĂ©rifier les fichiers importants if [ -f "Dockerfile" ]; then echo " 🐳 Dockerfile prĂ©sent" fi if [ -f "docker-compose.yml" ]; then echo " 🐙 docker-compose.yml prĂ©sent" fi if [ -f ".env" ]; then echo " ⚙ Fichier .env prĂ©sent" fi cd "$BASE_DIR" else echo " ❌ Dossier introuvable" fi echo "" done # VĂ©rifier le dĂ©pĂŽt 4NK_env lui-mĂȘme log "🏠 Statut du dĂ©pĂŽt 4NK_env:" cd "$BASE_DIR" if [ -d ".git" ]; then current_branch=$(git branch --show-current 2>/dev/null || echo "N/A") last_commit=$(git log -1 --oneline 2>/dev/null || echo "Aucun commit") git_status=$(git status --porcelain 2>/dev/null || echo "Erreur Git") echo " ✅ DĂ©pĂŽt Git 4NK_env dĂ©tectĂ©" echo " 📍 Branche: $current_branch" echo " 📝 Dernier commit: $last_commit" if [ "$git_status" = "Erreur Git" ]; then echo " ⚠ ProblĂšme Git dĂ©tectĂ©" elif [ -n "$git_status" ]; then echo " 🔄 Modifications non commitĂ©es" else echo " ✅ DĂ©pĂŽt propre" fi else echo " ⚠ DĂ©pĂŽt 4NK_env non initialisĂ©" echo " 💡 ExĂ©cutez: ./scripts/init-4nk-env-repo.sh" fi echo "" log "📋 RĂ©sumĂ© des actions recommandĂ©es:" # VĂ©rifier quels projets ne sont pas sur la branche ext ext_missing=() for project in "${PROJECTS[@]}"; do project_path="$BASE_DIR/$project" if [ -d "$project_path/.git" ]; then cd "$project_path" current_branch=$(git branch --show-current 2>/dev/null || echo "N/A") if [ "$current_branch" != "ext" ]; then ext_missing+=("$project") fi cd "$BASE_DIR" fi done if [ ${#ext_missing[@]} -gt 0 ]; then echo " 🔄 Projets Ă  mettre sur la branche 'ext':" for project in "${ext_missing[@]}"; do echo " - $project" done echo " 💡 ExĂ©cutez: ./scripts/clone-all-repos.sh" fi # VĂ©rifier les fichiers manquants missing_files=() for file in ".gitignore" ".dockerignore" "README.md"; do if [ ! -f "$BASE_DIR/$file" ]; then missing_files+=("$file") fi done if [ ${#missing_files[@]} -gt 0 ]; then echo " 📄 Fichiers manquants:" for file in "${missing_files[@]}"; do echo " - $file" done fi echo "" log "✅ VĂ©rification terminĂ©e"