Files
proxmox-ha-setup/vm2/deploy-ha.sh
2025-10-31 21:00:14 +01:00

34 lines
587 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
set -e
NODE_NAME=$(hostname)
echo "🚀 Deploying on $NODE_NAME..."
if [ ! -f .env ]; then
echo "⚠ .env not found, copying from .env.example"
cp .env.example .env
fi
source .env
echo "✓ Building images..."
docker compose build
echo "✓ Starting services..."
docker compose up -d
sleep 10
echo "✓ Checking VIP..."
if ip addr show | grep -q "${VIP}"; then
echo "✓ This node has the VIP (MASTER)"
else
echo " This node does not have the VIP (BACKUP)"
fi
echo "✓ Services status:"
docker compose ps
echo ""
echo "✅ Deployment completed!"