- Updated .gitignore to exclude /deployment/build/ directory - Added FTP_PORT configuration to .env.upload.example - Enhanced upload.sh to support custom SSH ports (default 22, configurable) - Deployment build artifacts are now properly excluded from version control The upload script now correctly handles custom SSH ports like 2222.
Deployment Scripts
Diese Verzeichnis enthält alle Scripts für das Deployment der AdsPreview React Anwendung.
📁 Scripts Übersicht
setup.sh - Initiales Setup
./setup.sh
- Installiert Frontend Dependencies
- Erstellt Development Build zum Testen
- Bereitet Backend-Verzeichnisse vor
- Erstellt Standard-Konfigurationsdateien
deploy.sh - Production Deployment
./deploy.sh
- Erstellt optimierten Production Build
- Kopiert alle notwendigen Dateien nach
deployment/build/ - Setzt korrekte Dateiberechtigungen
- Bereitet Upload-ready Struktur vor
upload.sh - Webspace Upload
# WICHTIG: Erst .env.upload konfigurieren!
cp .env.upload.example .env.upload
# Bearbeite .env.upload mit deinen FTP-Zugangsdaten
./upload.sh
- Uploaded
deployment/build/Inhalt via SFTP/FTP - 🔒 SICHER: Verwendet .env.upload für Zugangsdaten (nicht in Git!)
- Benötigt
lftpTool (brew install lftp)
🚀 Deployment Workflow
-
Einmalig: Setup ausführen
cd deployment/scripts ./setup.sh -
FTP-Zugangsdaten konfigurieren (einmalig):
cp .env.upload.example .env.upload # Bearbeite .env.upload mit deinen echten Zugangsdaten -
Production Build erstellen:
./deploy.sh -
Auf Webspace hochladen:
./upload.sh
📦 Deployment-Struktur
Nach deploy.sh wird folgende Struktur erstellt:
deployment/build/
├── public/ # React App + PHP Entry Points
│ ├── index.html # React SPA
│ ├── index.php # PHP Backend Entry
│ ├── files.php # File Service
│ └── static/ # React Assets (CSS, JS)
├── src/ # PHP Backend Code
│ ├── Api/ # API Controllers
│ ├── Core/ # Application Core
│ ├── Helper/ # Utility Functions
│ └── Services/ # Business Logic
├── storage/ # Application Data
│ └── data/ # JSON Storage Files
└── vendor/ # PHP Dependencies (GetID3)
<EFBFBD> Sicherheitshinweise
FTP-Zugangsdaten (.env.upload)
- NIEMALS Zugangsdaten direkt ins Script schreiben
- IMMER .env.upload für sensible Daten verwenden
- .env.upload ist automatisch von Git ausgeschlossen
- Template: .env.upload.example zeigt die Struktur
# .env.upload Beispiel:
FTP_HOST="dein-server.de"
FTP_USER="dein-username"
FTP_PASS="dein-passwort"
FTP_PATH="/htdocs"
🔧 Anpassungen
nginx Konfiguration
Siehe ../nginx/ Verzeichnis für Server-Konfiguration.
💡 Tipps
- Scripts laufen von überall: Die Scripts erkennen automatisch ihren Standort
- Backup: Sichere vor Upload immer deine Live-Daten
- Testing: Teste zuerst mit
setup.shbevor dudeploy.shverwendest - Logs: Scripts geben detaillierte Status-Informationen aus