32 lines
902 B
Bash
32 lines
902 B
Bash
#!/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
|