You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

69 rivejä
3.4 KiB

  1. #!/bin/bash
  2. set -e
  3. # ══════════════════════════════════════════════════════════════════════
  4. # Konfiguration – einmalig anpassen
  5. # ══════════════════════════════════════════════════════════════════════
  6. # Verzeichnis des Git-Repos (enthält httpdocs/, .git/, etc.)
  7. GIT_DIR="/var/www/vhosts/memap.de/httpdocs/timetracking/timetracking-git-repo"
  8. # Verzeichnis, aus dem die App läuft (Document Root ist dann APP_DIR/public)
  9. APP_DIR="/var/www/vhosts/memap.de/httpdocs/timetracking/timetracking-copy"
  10. # Binaries
  11. PHP="/opt/plesk/php/8.4/bin/php"
  12. COMPOSER="/usr/local/bin/composer84"
  13. NPM="/home/flo/.nodenv/versions/16/bin/npm"
  14. # ══════════════════════════════════════════════════════════════════════
  15. echo ""
  16. echo "╔══════════════════════════════════════╗"
  17. echo "║ spawntree Timetracker – Deploy ║"
  18. echo "╚══════════════════════════════════════╝"
  19. echo ""
  20. # ── 1. Git aktualisieren ───────────────────────────────────────────────
  21. echo "⏳ [1/7] Git pull..."
  22. git -C "$GIT_DIR" pull
  23. # ── 2. Dateien ins App-Verzeichnis synchronisieren ────────────────────
  24. # Quelle: httpdocs/ im Repo, nicht der Repo-Root
  25. echo "⏳ [2/7] Dateien synchronisieren..."
  26. rsync -av --delete \
  27. --exclude=".git" \
  28. --exclude="node_modules" \
  29. --exclude="var/cache" \
  30. --exclude="var/log" \
  31. --exclude=".env.local" \
  32. --exclude=".env.*.local" \
  33. "$GIT_DIR/httpdocs/" "$APP_DIR/"
  34. # ── 3. Composer Dependencies installieren ─────────────────────────────
  35. echo "⏳ [3/7] Composer install..."
  36. cd "$APP_DIR"
  37. export APP_ENV=prod
  38. "$PHP" "$COMPOSER" install --no-dev --optimize-autoloader --no-interaction --no-scripts
  39. # ── 4. Central-Migrationen ausführen ──────────────────────────────────
  40. echo "⏳ [4/7] Central-Migrationen..."
  41. "$PHP" bin/console doctrine:migrations:migrate --em=central --no-interaction
  42. # ── 5. Tenant-Schemas aktualisieren ───────────────────────────────────
  43. echo "⏳ [5/7] Tenant-Schemas aktualisieren..."
  44. "$PHP" bin/console app:update-tenant-schema
  45. # ── 6. Cache leeren ───────────────────────────────────────────────────
  46. echo "⏳ [6/7] Cache leeren..."
  47. "$PHP" bin/console cache:clear
  48. # ── 7. Assets bauen ───────────────────────────────────────────────────
  49. echo "⏳ [7/7] Assets bauen (npm)..."
  50. "$NPM" ci
  51. "$NPM" run build
  52. echo ""
  53. echo "✅ Deploy abgeschlossen."
  54. echo ""