From 2f1ca5533fb582a5cb11e5fdbd8a164b26061b7c Mon Sep 17 00:00:00 2001 From: Michel Date: Thu, 17 Apr 2025 15:13:16 +0200 Subject: [PATCH] =?UTF-8?q?"Nouveau=20fichier=20deploy=20pour=20r=C3=A9cup?= =?UTF-8?q?=C3=A9rer=20les=20fichiers=20develop=20sur=20product"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/deploy_product.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tools/deploy_product.sh diff --git a/tools/deploy_product.sh b/tools/deploy_product.sh new file mode 100644 index 0000000..b6a8960 --- /dev/null +++ b/tools/deploy_product.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +LOG="/home/debian/travail/Logs/deploy_product.log" +REPO_PATH="/home/debian/travail/Gestion_sondes" +DATE=$(date '+%Y-%m-%d %H:%M:%S') + +echo "[$DATE] 🚀 Déploiement de la branche develop vers product" >> $LOG + +cd $REPO_PATH + +# 1. Récupérer les dernières modifs +git fetch origin >> $LOG 2>&1 + +# 2. Basculer sur la branche product +git checkout product >> $LOG 2>&1 + +# 3. Mettre à jour tous les .py depuis develop +git checkout origin/develop -- *.py >> $LOG 2>&1 + +# 4. Commit et push +git commit -am "🧩 Déploiement auto : maj des fichiers .py depuis develop" >> $LOG 2>&1 +git push origin product >> $LOG 2>&1 + +# 5. Redémarrage des services Supervisor +for service in Cuisine_Saclay Monitor cuisine_meudon domo91 Interface +do + supervisorctl restart $service >> $LOG 2>&1 +done + +DATE_END=$(date '+%Y-%m-%d %H:%M:%S') +echo "[$DATE_END] ✅ Déploiement terminé avec succès." >> $LOG