refactor(deploy): Vereinfachung des Deployment-Skripts durch Entfernen nicht mehr benötigter Schritte
- Entfernen der Erstellung der Verzeichnisstruktur und der Installation von Systemd- und Apache-Konfigurationen. - Integration des Frontend-Deployments über ein separates Skript.
This commit is contained in:
53
deploy.sh
53
deploy.sh
@@ -15,10 +15,6 @@ if ! command -v sudo &> /dev/null; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Verzeichnisstruktur erstellen
|
||||
echo "Creating directory structure..."
|
||||
sudo mkdir -p /opt/yourpart/{frontend,backend}
|
||||
|
||||
# Backend deployen
|
||||
echo ""
|
||||
echo "=== Deploying Backend ==="
|
||||
@@ -27,54 +23,7 @@ echo "=== Deploying Backend ==="
|
||||
# Frontend bauen und deployen
|
||||
echo ""
|
||||
echo "=== Building and Deploying Frontend ==="
|
||||
./build-frontend.sh
|
||||
|
||||
# Systemd Service installieren
|
||||
echo ""
|
||||
echo "=== Installing Systemd Service ==="
|
||||
sudo cp yourpart.service /etc/systemd/system/
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable yourpart.service
|
||||
|
||||
# Apache-Konfiguration installieren
|
||||
echo ""
|
||||
echo "=== Installing Apache Configuration ==="
|
||||
sudo cp yourpart-http.conf /etc/apache2/sites-available/yourpart-http.conf
|
||||
sudo cp yourpart-https.conf /etc/apache2/sites-available/yourpart-https.conf
|
||||
|
||||
# Alte Konfiguration deaktivieren (falls vorhanden)
|
||||
sudo a2dissite yourpart 2>/dev/null || true
|
||||
|
||||
# Neue Konfiguration aktivieren
|
||||
sudo a2ensite yourpart-http
|
||||
sudo a2ensite yourpart-https
|
||||
|
||||
# Apache-Module aktivieren
|
||||
echo "Enabling required Apache modules..."
|
||||
sudo a2enmod proxy
|
||||
sudo a2enmod proxy_http
|
||||
sudo a2enmod proxy_wstunnel
|
||||
sudo a2enmod rewrite
|
||||
sudo a2enmod ssl
|
||||
|
||||
# Apache neu laden
|
||||
echo "Reloading Apache..."
|
||||
sudo systemctl reload apache2
|
||||
|
||||
# Backend-Service starten
|
||||
echo ""
|
||||
echo "=== Starting Backend Service ==="
|
||||
sudo systemctl start yourpart.service
|
||||
|
||||
# Status anzeigen
|
||||
echo ""
|
||||
echo "=== Deployment Status ==="
|
||||
echo "Backend Service Status:"
|
||||
sudo systemctl status yourpart.service --no-pager -l
|
||||
|
||||
echo ""
|
||||
echo "Apache Status:"
|
||||
sudo systemctl status apache2 --no-pager -l
|
||||
./deploy-frontend.sh
|
||||
|
||||
echo ""
|
||||
echo "=== Deployment Completed! ==="
|
||||
|
||||
Reference in New Issue
Block a user