V1.1 du module de déploiement automatique sur le serveur
This commit is contained in:
parent
702ad29822
commit
3d52144ad7
1 changed files with 4 additions and 4 deletions
|
|
@ -44,12 +44,12 @@ def run_mep_logic(author, commit_msg):
|
|||
subprocess.run(["git", "fetch", "origin"], check=True)
|
||||
subprocess.run(["git", "reset", "--hard", "origin/main"], check=True)
|
||||
|
||||
# 2. PM2
|
||||
subprocess.run(f"pm2 restart {PROCESS_NAME}", shell=True, check=True, capture_output=True)
|
||||
|
||||
duration = (datetime.now() - start_time).total_seconds()
|
||||
msg = f"✅ **Déploiement réussi en {duration:.2f}s**\nLe bot est à jour et redémarré."
|
||||
send_discord_log("TERMINÉ", msg, 3066993, author, commit_msg)
|
||||
send_discord_log("VALIDÉ", msg, 3066993, author, commit_msg)
|
||||
|
||||
# 2. PM2 (Appelé après le message pour éviter que le kill du serv ne bloque l'envoi)
|
||||
subprocess.run(f"pm2 restart {PROCESS_NAME}", shell=True, check=True, capture_output=True)
|
||||
|
||||
except Exception as e:
|
||||
error_msg = f"❌ **ERREUR de déploiement**\n```python\n{str(e)}\n```"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue