23 lines
774 B
Bash
Executable File
23 lines
774 B
Bash
Executable File
#!/bin/bash
|
|
# Script de déploiement DevOps pour status-monitor
|
|
# Utilisation: wsl bash ~/homelab-config/status-monitor/deploy.sh
|
|
|
|
set -e
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
REPO_DIR="$(dirname "$SCRIPT_DIR")"
|
|
|
|
echo "[DEPLOY] Début du déploiement depuis Git..."
|
|
|
|
echo "[DEPLOY] Transfert des fichiers vers CT201..."
|
|
scp -J root@192.168.0.100 -i ~/.ssh/id_ed25519 "$SCRIPT_DIR/app.py" root@192.168.0.201:/tmp/app.py
|
|
|
|
echo "[DEPLOY] Installation sur CT201..."
|
|
ssh -J root@192.168.0.100 -i ~/.ssh/id_ed25519 root@192.168.0.201 << 'ENDSSH'
|
|
mv /tmp/app.py /opt/status-monitor/app.py
|
|
systemctl restart status-monitor
|
|
echo "[DEPLOY] ✅ Déploiement terminé sur CT201 !"
|
|
ENDSSH
|
|
|
|
echo "[DEPLOY] Déploiement terminé avec succès !"
|