presseportale/setup-new-asset-urls.sh
Kevin Adametz 5b8bdf4182
Some checks are pending
linter / quality (push) Waiting to run
tests / ci (push) Waiting to run
12-05-2026 Frontend dev
2026-05-12 18:32:33 +02:00

93 lines
2.6 KiB
Bash
Executable file
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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
# Setup-Script für die neue Asset-URL Struktur
echo "🔧 Setup für neue Asset-URL Struktur"
echo "======================================"
echo ""
# Schritt 1: DNS-Einträge prüfen
echo "📋 Schritt 1: DNS-Einträge prüfen"
echo ""
echo "Bitte stelle sicher, dass folgende Einträge in deiner Hosts-Datei existieren:"
echo ""
echo "127.0.0.1 presseportale.test"
echo "127.0.0.1 assets.presseportale.test"
echo "127.0.0.1 assets.presseecho.test"
echo "127.0.0.1 assets.businessportal24.test"
echo ""
read -p "Sind die DNS-Einträge vorhanden? (j/n): " dns_ok
if [[ ! "$dns_ok" =~ ^[jJ]$ ]]; then
echo ""
echo "⚠️ Bitte füge die DNS-Einträge hinzu und starte das Script erneut."
echo ""
echo "Hosts-Datei bearbeiten:"
echo " macOS/Linux: sudo nano /etc/hosts"
echo " Windows: C:\\Windows\\System32\\drivers\\etc\\hosts"
echo ""
exit 1
fi
# Schritt 2: Cache leeren
echo ""
echo "🧹 Schritt 2: Laravel Cache leeren"
php artisan config:clear
php artisan cache:clear
php artisan view:clear
echo "✅ Cache geleert"
# Schritt 3: Traefik-Status prüfen
echo ""
echo "🔍 Schritt 3: Traefik-Routen testen"
echo ""
# Test mit curl (SSL-Verifikation ignorieren für self-signed certs)
echo "Teste assets.presseportale.test..."
if curl -Iks https://assets.presseportale.test | head -1 | grep -q "404\|200"; then
echo " ✅ Erreichbar über HTTPS"
else
echo " ⚠️ Nicht erreichbar - Docker Container neu starten!"
fi
echo "Teste assets.presseecho.test..."
if curl -Iks https://assets.presseecho.test | head -1 | grep -q "404\|200"; then
echo " ✅ Erreichbar über HTTPS"
else
echo " ⚠️ Nicht erreichbar - Docker Container neu starten!"
fi
echo "Teste assets.businessportal24.test..."
if curl -Iks https://assets.businessportal24.test | head -1 | grep -q "404\|200"; then
echo " ✅ Erreichbar über HTTPS"
else
echo " ⚠️ Nicht erreichbar - Docker Container neu starten!"
fi
# Schritt 4: Vite-Server prüfen
echo ""
echo "🚀 Schritt 4: Vite-Server Status"
if pgrep -f "vite --config" > /dev/null; then
echo " Vite-Server laufen bereits"
read -p "Vite-Server neu starten? (j/n): " restart_vite
if [[ "$restart_vite" =~ ^[jJ]$ ]]; then
pkill -f "vite --config"
sleep 2
echo " ✅ Alte Vite-Server gestoppt"
fi
else
echo " Keine Vite-Server aktiv"
fi
echo ""
echo "======================================"
echo "✅ Setup abgeschlossen!"
echo ""
echo "Nächste Schritte:"
echo "1. Vite-Server starten: npm run dev:all"
echo "2. Browser aufrufen und testen"
echo ""
echo "📖 Dokumentation: VITE-SETUP-NEUE-STRUKTUR.md"
echo ""