40 lines
1.5 KiB
Bash
Executable File
40 lines
1.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# deploy.sh - Deploy Erugo Views & Themes
|
|
# Domain: upload.free-warez.win
|
|
# Target Host: free-warez.win -> /opt/containers/erugo/views
|
|
|
|
set -euo pipefail
|
|
|
|
TARGET_HOST="free-warez.win"
|
|
TARGET_DIR="/opt/containers/erugo/views"
|
|
LOCAL_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
|
echo "🚀 Deploying Erugo Views & Banner Logo"
|
|
echo " Target: $TARGET_HOST:$TARGET_DIR"
|
|
echo "==============================================="
|
|
|
|
# 1. Check SSH connection
|
|
echo "📡 Checking SSH connection to $TARGET_HOST..."
|
|
if ! ssh -q -o BatchMode=yes -o ConnectTimeout=5 "$TARGET_HOST" exit; then
|
|
echo "❌ Cannot connect to $TARGET_HOST via SSH."
|
|
exit 1
|
|
fi
|
|
|
|
# 2. Sync Views
|
|
echo "🔄 Syncing blade templates & views..."
|
|
rsync -avz --delete "$LOCAL_DIR/views/" "$TARGET_HOST:$TARGET_DIR/"
|
|
|
|
# 3. Sync Logo Banner if present
|
|
if [ -f "$LOCAL_DIR/assets/logo.png" ]; then
|
|
echo "🎨 Syncing 3D Banner Logo..."
|
|
rsync -avz "$LOCAL_DIR/assets/logo.png" "$TARGET_HOST:/opt/containers/erugo/erugo-storage/app/public/images/logo.png"
|
|
ssh "$TARGET_HOST" "chown hermes:hermes /opt/containers/erugo/erugo-storage/app/public/images/logo.png && sqlite3 /opt/containers/erugo/erugo-storage/app/private/database.sqlite 'UPDATE settings SET value = 420 WHERE key = \"logo_width\";'"
|
|
fi
|
|
|
|
# 4. Restart container to flush template & asset caches
|
|
echo "🔄 Restarting Erugo container..."
|
|
ssh "$TARGET_HOST" "docker restart erugo"
|
|
|
|
echo "✅ Erugo updated!"
|
|
echo "✨ Deployment complete!"
|